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); }
private static void SortBySelectedSortingAlgorithm(int sortingAlgorithm, int[] arrayToSort, string displaySteps) { SelectSortingMethod.SortBySelectedMethod(sortingAlgorithm, arrayToSort, displaySteps); }