public static void SelectMethodOfSorting(Data.ListData listData) { _selectedMethod = MethodListAndSortedList.ChooseMethod(); switch (_selectedAlgorithm) { case 0: new QuickSort(_selectedMethod, listData); break; case 1: new BubbleSort(_selectedMethod, listData); break; case 2: new BucketSort(_selectedMethod, listData); break; } }
public static void TheSoftware() { do { //Make Algorith Menu and Select one _exit = SelectAlgorithm(); if (_exit == -1) { break; } _synthdata = Menus.GenerateSynthData(); SelectMethodOfSorting(_synthdata); while (Menus.RunWithSameData() == true) { SelectMethodOfSorting(_synthdata); } //Ask to Run Again Menus.RunAgain(); } while (_exit != -1); }
public QuickSort(int methodSelection, Data.ListData listData) { List <TShirt> _unsortedList = listData.UnsortedList; Console.Clear(); int row = 2; switch (methodSelection) { case 0: SortBySizeASC(_unsortedList); foreach (var shirt in _unsortedList) { Console.SetCursorPosition(80, row++); shirt.Stringify(shirt); } Console.ReadLine(); break; case 1: SortBySizeDESC(_unsortedList); foreach (var shirt in _unsortedList) { Console.SetCursorPosition(80, row++); shirt.Stringify(shirt); } Console.ReadLine(); break; case 2: SortByColorASC(_unsortedList); foreach (var shirt in _unsortedList) { Console.SetCursorPosition(80, row++); shirt.Stringify(shirt); } Console.ReadLine(); break; case 3: SortByColorDESC(_unsortedList); foreach (var shirt in _unsortedList) { Console.SetCursorPosition(80, row++); shirt.Stringify(shirt); } Console.ReadLine(); break; case 4: SortByFabricASC(_unsortedList); foreach (var shirt in _unsortedList) { Console.SetCursorPosition(80, row++); shirt.Stringify(shirt); } Console.ReadLine(); break; case 5: SortByFabricDESC(_unsortedList); foreach (var shirt in _unsortedList) { Console.SetCursorPosition(80, row++); shirt.Stringify(shirt); } Console.ReadLine(); break; case 6: SortBySizeThenColorThenFabricASC(_unsortedList); foreach (var shirt in _unsortedList) { Console.SetCursorPosition(80, row++); shirt.Stringify(shirt); } Console.ReadLine(); break; case 7: SortBySizeThenColorThenFabricDESC(_unsortedList); foreach (var shirt in _unsortedList) { Console.SetCursorPosition(80, row++); shirt.Stringify(shirt); } Console.ReadLine(); break; default: break; } }