static void ShowSortResult() { InsertSortor <int> insertSort = new InsertSortor <int>(); SortorHelper.TestSort <int>(insertSort, null); ShellSortor <int> shellSort = new ShellSortor <int>(); SortorHelper.TestSort <int>(shellSort, null); BubbleSortor <int> bubbleSort = new BubbleSortor <int>(); SortorHelper.TestSort <int>(bubbleSort, null); int[] intgArr = { 5, 9, 1, 4, 1, 2, 6, 3, 8, 0, 7 }; var mergeSort = new MergeSortor <int>(); SortorHelper.TestSort <int>(mergeSort, null); SortorHelper.TestSort <int>(new SelectSortor <int>(), null); SortorHelper.TestSort <int>(new QuickSortor <int>(), null); SortorHelper.TestSort <int>(new HeapSortor <int>(), null); }
static void PerformanceTest() { ShellSortor <int> shellSort = new ShellSortor <int>(); Console.WriteLine("ShellSortor "); SortorHelper.TestSort <int>(shellSort, null, true); int[] intgArr = { 5, 9, 1, 4, 1, 2, 6, 3, 8, 0, 7 }; var mergeSort = new MergeSortor <int>(); Console.WriteLine("MergeSortor "); SortorHelper.TestSort <int>(mergeSort, null, true); Console.WriteLine("QuickSortor "); SortorHelper.TestSort <int>(new QuickSortor <int>(), null, true); Console.WriteLine("HeapSortor "); SortorHelper.TestSort <int>(new HeapSortor <int>(), null, true); }