package iYou.neugle.sort;
public class Quick_sort {
public static void QuickSort(double[] array, int left, int right) {
if (left < right) {
int i = Division(array, left, right);
QuickSort(array, left, i - 1);
QuickSort(array, i + 1, right);
}
}
private static int Division(double[] array, int left, int right) {
double base = array[left];
while (left < right) {
while (left < right && array[right] >= base) {
right--;
}
array[left] = array[right];
while (left < right && array[left] <= base) {
left++;
}
array[right] = array[left];
}
array[left] = base;
return left;
}
}