package rggdg;
public class Rgg {
public static final int SIZE=20;
public static int partition(int l, int r, int data[])
{
int v = data[r];
int i = l - 1;
int j = r;
while(SIZE>0){
while(data[++i] < v);
while(v < data[--j]) if(j == i) break;
if(j <= i) break;
int t = data[i]; data[i] = data[j]; data[j] = t;
}
int t = data[i]; data[i] = data[r]; data[r] = t;
return i;
}
public static void quickSort(int l, int r, int data[])
{
if (r <= l) {
return;
}
int p = partition(l, r, data);
quickSort(l, p - 1, data);
quickSort(p + 1, r, data);
}
public static void main(String[] args){
int[] a={67,98,2,34,23,56,34,78,56,35,67,45,96};
quickSort(0,a.length,a);
}
}