예제 #1
0
파일: Program.cs 프로젝트: Fedoop1/Sortings
        static void Main(string[] args)
        {
            ArrayGenerator arrayGenerator = new ArrayGenerator();
            InsertSort     insertSort     = new InsertSort();

            int[] insertSortMas = arrayGenerator.Generate(10);

            Console.WriteLine("\nBefore:");
            foreach (var item in insertSortMas)
            {
                Console.Write(item + " ");
            }

            Console.WriteLine("\n--- Insert Sort ---");
            insertSortMas = insertSort.Sort(insertSortMas);

            Console.WriteLine("After:");
            foreach (var item in insertSortMas)
            {
                Console.Write(item + " ");
            }

            QuickSort quickSort = new QuickSort();

            int[] quickSortMas = arrayGenerator.Generate(10);

            Console.WriteLine("\n\nBefore:");
            foreach (var item in quickSortMas)
            {
                Console.Write(item + " ");
            }

            int[] quickSorted = quickSort.Sort(quickSortMas);

            Console.WriteLine("\n--- Quick Sort ---");
            Console.WriteLine("After:");
            foreach (var item in quickSorted)
            {
                Console.Write(item + " ");
            }

            Console.ReadLine();
        }