public static void SortNumbers(int[] array, ICompareCriterion compareCriterion, IIndexCriterion indexCriterion, int convertTo) { string[] parsedArr = new string[array.Length]; Converter(array, parsedArr, convertTo); BubbleSort(parsedArr, compareCriterion, indexCriterion); ConvertToInt(parsedArr, array); }
private static void BubbleSort(string[] array, ICompareCriterion compareCriterion, IIndexCriterion indexCriterion) { compareCriterion = new CompareBySmth(); indexCriterion = new IndexCriterion(); // доделать логику на indexCriterion for (int i = 0; i < array.Length; i++) { for (int j = i + 1; j < array.Length; j++) { if (compareCriterion.CompareNumbers(array[i], array[j])) { string temp = array[i]; array[i] = array[j]; array[j] = temp; } } } }