public void TestSelection() { Selection selectionSort = new Selection(); string[] a = { "S", "O", "R", "T", "E", "X", "A", "M", "P", "L", "E" }; selectionSort.Sort(a); Assert.AreEqual(selectionSort.isSorted(a), true); }
public static double time(string alg, IComparable[] a) { Stopwatch timer = new Stopwatch(); if (alg.Equals("Insertion")) { var sort = new Insertion(); sort.Sort(a); } else { var sort = new Selection(); sort.Sort(a); } return timer.ElapsedMilliseconds; }