示例#1
0
        private static void TrySort()
        {
            SortBase sort = new InsertSort();

            sort.Print("-------- before insert sort ----------");
            sort.DoSort();
            sort.Print("-------- after insert sort ----------");

            SortBase ms = new MergeSort();

            ms.Print("-------- before merge sort ----------");
            ms.DoSort();
            ms.Print("-------- after merge sort ----------");

            SortBase hs = new HeapSort();

            hs.Print("-------- before heap sort ----------");
            hs.DoSort();
            hs.Print("-------- after heap sort ----------");

            QuickSort qs = new QuickSort();

            qs.Print("-------- before quick sort ----------");
            qs.DoSort();
            qs.Print("-------- after quick sort ----------");

            CountingSort cs = new CountingSort();

            cs.Print("-------- before quick sort ----------");
            cs.DoSort();
            cs.Print("-------- after quick sort ----------");
        }