#define SIZE 20
int partition(int l, int r, int data[SIZE])
{
int v = data[r];
int i = l - 1;
int j = r;
while(1){
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;
}
void quickSort(int l, int r, int data[SIZE])
{
if (r <= l) {
return;
}
int p = partition(l, r, data);
quickSort(l, p - 1, data);
quickSort(p + 1, r, data);
}