Example #1
0
        private static void MergerSortDemostration()
        {
            int[] arr = { 4, 8, 5, 3, 9, 2, 4, 5, 1 };

            MergerSortDemo.Mergersort(arr, arr.Length);
            MergerSortDemo.PrintAnArray(arr);
        }
Example #2
0
        private static void InsertionSortDemostration()
        {
            int[] arr = { 4, 8, 5, 3, 9, 2, 4, 5, 1 };

            MergerSortDemo.PrintAnArray(arr);
            InsertionSort.insertionSort(arr);
            MergerSortDemo.PrintAnArray(arr);
        }
Example #3
0
        private static void QuickSortDemostration()
        {
            int[] arr = { 10, 3, 2, 7, 7, 5, 8, 4, 1, 2, 9, 7, 8, 11 };
            //int[] arr = { -20, 2, 5, 3, 7, 5, 8, -4, 9, 23, 111 };
            // int[] arr = { 10, 20, 30, 50, 60, 40 };
            //int[] arr = { 3, 9, 1, 4, 7 };
            Console.WriteLine("Before sorting....");

            MergerSortDemo.PrintAnArray(arr);
            QuickSort.quickSorting(arr, 0, arr.Length - 1);

            Console.WriteLine("After sorting....");
            MergerSortDemo.PrintAnArray(arr);
        }