Monthly Archives: May 2010

History Grading

Background Many problems in Computer Science involve maximizing some measure according to constraints. Consider a history exam in which students are asked to put several historical events into chronological order. Students who order all the events correctly will receive full … Continue reading

Posted in Information Technology | Leave a comment

Calculating the number of trains required based on duration of journey

using System; using System.Collections.Generic; using System.Collections; using System.Linq; using System.Text; using System.Text.RegularExpressions;   namespace ConsoleApplication1 {     class Program     {         static void Main(string[] args)         {             try             {                 string format = "ddd hh:mm tt";                 … Continue reading

Posted in Information Technology | Leave a comment

The founders of …

Posted in Entertainment | Leave a comment

Find the first repeated character in a word

using System; using System.Collections.Generic; using System.Collections; using System.Linq; using System.Text;   namespace ConsoleApplication1 {     class Program     {         static void Main(string[] args)         {             //Find the first repeated character in a word             string word = "character"; … Continue reading

Posted in Information Technology | Leave a comment

Printing the max length substring with max repetition count

using System; using System.Collections.Generic; using System.Collections; using System.Linq; using System.Text;   namespace ConsoleApplication1 {     class Program     {         static void Main(string[] args)         {             string str = "abcabcabcabc";             Hashtable ht = new Hashtable();             //Substring length … Continue reading

Posted in Information Technology | Leave a comment

Given an array of numbers, return array of products of all other numbers

using System; using System.Collections.Generic; using System.Collections; using System.Linq; using System.Text;   namespace ConsoleApplication1 {     class Program     {         static void Main(string[] args)         {             int[] numArray = { 1, 2, 3, 4, 5 };             int[] tempArray1 … Continue reading

Posted in Information Technology | Leave a comment

Height of a binary tree

using System; using System.Collections.Generic; using System.Collections; using System.Linq; using System.Text;   namespace ConsoleApplication1 {     public class Node     {         private Node left;         private Node right;         private int value;         public Node(Node left, Node right, int value) … Continue reading

Posted in Information Technology | Leave a comment