public class QuickSort {
public static void sort(int data[], int start, int end) {
if (end - start <= 0) {
return;
}
int last = start;
for (int i = start + 1; i <= end; i++) {
if (data[i] < data[start]) {
int temp = data[++last];
data[last] = data[i];
data[i] = temp;
}
}
int temp = data[last];
data[last] = data[start];
data[start] = temp;
sort(data, start, last - 1);
sort(data, last + 1, end);
}
}