public static void MainTest(string[] args) { TextInput StdIn = new TextInput(); string[] a = StdIn.ReadAllStrings(); InsertionX.Sort(a); OrderHelper.Show(a); }
public static void MainTest(string[] args) { int[] a = { 33, 22, 11, 31, 35, 27, 24, 25 }; StaticSETofInts set = new StaticSETofInts(a); Console.WriteLine("Set contains:"); OrderHelper.Show(a); Console.WriteLine("Set contains {0}: {1}", 11, set.Contains(11)); Console.WriteLine("Rank of {0}: {1} with same rank: {2}", 35, set.Rank(35), (a.Length - 1) == set.Rank(35)); }
public static void MainTest(string[] args) { TextInput StdIn = new TextInput(); string[] a = StdIn.ReadAllStrings(); OrderHelper.Show(a); // shuffle StdRandom.Shuffle(a); // display results again using select Console.WriteLine(); for (int i = 0; i < a.Length; i++) { string ith = (string)Quick.Select(a, i); Console.WriteLine(ith); } }