public static void Quick_Sort(int[] args)
        {
            int size = args.Length;

            Sort(args, size);

            Console.WriteLine("QuickSort Sorted: ");
            DisplayElements.ShowElements(args, size);
        }
Beispiel #2
0
        public static void Merge_Sort(int[] args)
        {
            int size = args.Length;

            Sort(args, size);
            Console.WriteLine();

            Console.WriteLine("Sorted array is : ");
            DisplayElements.ShowElements(args, size);
            Console.WriteLine("Speed: ");
            Console.ReadLine();
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            int i, size;

            Console.Write("Enter the size of elements: ");
            size = Convert.ToInt32(Console.ReadLine());
            int[] a = new int[size];
            Random rand = new Random();
            for (i = 0; i < size; i++)
                a[i] = rand.Next(100, 999);

            Console.WriteLine("Original array: ");
            DisplayElements.ShowElements(a, size);
            Console.WriteLine();

            Console.WriteLine("Starting comparsion...");

            BubbleSort.Bubble_Sort(a);
            HeapSort.Heap_Sort(a);
            //InsertionSort(a);
            MergeSort.Merge_Sort(a);
            QuickSort.Quick_Sort(a);
               // SelectionSort(a);
        }