Esempio n. 1
0
        public static void RunStoringTests()
        {
            System.Console.WriteLine("Iniciando rotina de testes de armazenamento");
            SelectionSort selectionSort = new SelectionSort();
            BubbleSort    bubbleSort    = new BubbleSort();
            QuickSort     quickSort     = new QuickSort();
            MergeSort     mergeSort     = new MergeSort();

            bubbleSort.SortAndStore(NumberGeneratorService.GenerateTestArray());
            selectionSort.SortAndStore(NumberGeneratorService.GenerateTestArray());
            quickSort.SortAndStore(NumberGeneratorService.GenerateTestArray());
            mergeSort.SortAndStore(NumberGeneratorService.GenerateTestArray());
        }
Esempio n. 2
0
        public static void RunTests()
        {
            System.Console.WriteLine("Iniciando rotina de testes");
            SelectionSort selectionSort = new SelectionSort();
            BubbleSort    bubbleSort    = new BubbleSort();
            QuickSort     quickSort     = new QuickSort();
            MergeSort     mergeSort     = new MergeSort();

            double[] numbers1 = selectionSort.Sort(NumberGeneratorService.GenerateTestArray());
            double[] numbers2 = bubbleSort.Sort(NumberGeneratorService.GenerateTestArray());
            double[] numbers3 = quickSort.Sort(NumberGeneratorService.GenerateTestArray());
            double[] numbers4 = mergeSort.Sort(NumberGeneratorService.GenerateTestArray());
            System.Console.WriteLine("Organizado: " + selectionSort.SortTest(numbers1));
            PrintArray(numbers1);
            System.Console.WriteLine("Organizado: " + bubbleSort.SortTest(numbers2));
            PrintArray(numbers2);
            System.Console.WriteLine("Organizado: " + quickSort.SortTest(numbers3));
            PrintArray(numbers3);
            System.Console.WriteLine("Oganizado: " + mergeSort.SortTest(numbers4));
            PrintArray(numbers4);
        }