示例#1
0
文件: Sort.cs 项目: zaurb77/zaur
        public static void SortArray()
        {
            Console.WriteLine("Welcome to array sorting app.");

            var arraySortingMethod    = SelectSortingMethod.Method();
            var arrayGenerationMethod = MakeArray.AskForArrayGenerationMethod();
            var myArray = MakeArray.StartArrayGenerationByMethod(arrayGenerationMethod);

            PrintArray(myArray);
            var displaySortingSteps = AskForSortingStepsDisplay();

            SortBySelectedSortingAlgorithm(arraySortingMethod, myArray, displaySortingSteps);

            //Selection.Sort(myArray, displaySortingSteps);

            Console.WriteLine("Sorted array:");
            PrintArray(myArray);
        }
示例#2
0
文件: Sort.cs 项目: zaurb77/zaur
 private static void SortBySelectedSortingAlgorithm(int sortingAlgorithm, int[] arrayToSort, string displaySteps)
 {
     SelectSortingMethod.SortBySelectedMethod(sortingAlgorithm, arrayToSort, displaySteps);
 }