Example #1
0
        public void TestInsertionSortIntegers()
        {
            int[] unsortedIntegers = { 5, 3, 1, 9, 12 };
            int[] sortedIntegers   = { 1, 3, 5, 9, 12 };

            Assert.Equal(sortedIntegers, InsertionSort.Execute(unsortedIntegers));
        }
Example #2
0
        public void TestInsertionSortStringDuplicate()
        {
            string[] unsortedIntegers = { "Xray", "Alpha", "Charlie", "Beta", "Beta", "India" };
            string[] sortedIntegers   = { "Alpha", "Beta", "Beta", "Charlie", "India", "Xray" };

            Assert.Equal(sortedIntegers, InsertionSort.Execute(unsortedIntegers));
        }
Example #3
0
        public void TestInsertionSortIntegerEmpty()
        {
            int[] unsortedIntegers = { };
            int[] sortedIntegers   = { };

            Assert.Equal(sortedIntegers, InsertionSort.Execute(unsortedIntegers));
        }
Example #4
0
        public void TestInsertionSortStringEmpty()
        {
            string[] unsortedIntegers = { };
            string[] sortedIntegers   = { };

            Assert.Equal(sortedIntegers, InsertionSort.Execute(unsortedIntegers));
        }
Example #5
0
        static void Main(string[] args)
        {
            MergeSort     mergeSort     = new MergeSort();
            SelectionSort selectionSort = new SelectionSort();
            InsertionSort insertionSort = new InsertionSort();
            BubbleSort    bubbleSort    = new BubbleSort();
            CountingSort  countingSort  = new CountingSort();
            QuickSort     quickSort     = new QuickSort();

            mergeSort.Execute();
            selectionSort.Execute();
            insertionSort.Execute();
            bubbleSort.Execute();
            countingSort.Execute();
            quickSort.Execute();

            Console.ReadLine();
        }