public void SortDoubleData(ISorts sortingMethod, string nameOfSort) { stopWatch.ResetStopWatch(); stopWatch.StartStopWatch(); sortingMethod.Sort(); stopWatch.StopStopWatch(); stopWatch.GetTimeElapsed(nameOfSort); stopWatch.ResetStopWatch(); stopWatch.StartStopWatch(); sortingMethod.WriteSortList(); stopWatch.StartStopWatch(); stopWatch.GetTimeElapsed(nameOfSort + "To Write To File"); }
//I have two methods one for the guids and the other for Doubles public void SortGuidData(ISorts sortingMethod, string nameOfSort) { sortingMethod.ChangeGuidsToInt64(); stopWatch.ResetStopWatch(); stopWatch.StartStopWatch(); sortingMethod.Sort(); stopWatch.StopStopWatch(); stopWatch.GetTimeElapsed(nameOfSort); stopWatch.ResetStopWatch(); stopWatch.StartStopWatch(); sortingMethod.WriteSortList(); stopWatch.StartStopWatch(); stopWatch.GetTimeElapsed(nameOfSort + " To Write To File"); }
public void setTypeSort(ISorts sortsType) => _sortsType = sortsType;
public void ChoiceSort(SortName sort) { switch (sort) { case SortName.SELECTIONSORT: ConsoleManager.GreenSendToConSole("Сортировка Выбором"); SetNullForCompareAndTransposition(); SetStart(); SelectionSort(0, arrayLength - 1); SetEnd(); SetInterval(); break; case SortName.INSERTIONSORT: ConsoleManager.GreenSendToConSole("Сортировка Вставками"); SetNullForCompareAndTransposition(); SetStart(); InsertionSort(0, arrayLength - 1); SetEnd(); SetInterval(); break; case SortName.BUBBLESORT: ConsoleManager.GreenSendToConSole("Сортировка Пузырьком"); SetNullForCompareAndTransposition(); SetStart(); BubbleSort(0, arrayLength - 1); SetEnd(); SetInterval(); break; case SortName.SHAKERSORT: ConsoleManager.GreenSendToConSole("Сортировка Шейкерная"); SetNullForCompareAndTransposition(); SetStart(); ShakerSort(0, arrayLength - 1); SetEnd(); SetInterval(); break; case SortName.SHELLSORT: ConsoleManager.GreenSendToConSole("Сортировка Шелла"); SetNullForCompareAndTransposition(); SetStart(); ShellSort(0, arrayLength - 1); SetEnd(); SetInterval(); break; case SortName.MERGESORT: MySorts = new MergeSort(array); ConsoleManager.GreenSendToConSole("Сортировка Слиянием"); SetNullForCompareAndTransposition(); SetStart(); MySorts.Sort(0, arrayLength - 1); SetEnd(); SetInterval(); array = MySorts.a; break; case SortName.QUICKSORT: MySorts = new QuickSort(array); ConsoleManager.GreenSendToConSole("Быстрая сортировка"); SetNullForCompareAndTransposition(); SetStart(); MySorts.Sort(0, arrayLength - 1); SetEnd(); SetInterval(); array = MySorts.a; break; case SortName.HEAPSORT: MySorts = new HeapSorter(array); ConsoleManager.GreenSendToConSole("Сортировка Кучей"); SetNullForCompareAndTransposition(); SetStart(); MySorts.Sort(0, arrayLength - 1); SetEnd(); SetInterval(); array = MySorts.a; break; default: break; } }