QuickSort
void xuat(int L, int R){
printf("\n%2d -> %2d: ",L,R);
for(int i=1; i
printf(" ");
for(int i=L; i<=R; i++)
printf("%3d",a[i]);
getch();
}
int partition(int L, int H){
int x = a[L];
int ls = L, i=L+1;
while(i<=H){
if(a[i]<>
ls++;
HV(a[ls],a[i]);
}
i++;
}
HV(a[L],a[ls]);
xuat(L,H);
return ls;
}
void QS(int L, int R){
if(L<>
int pos = partition(L,R);
QS(L,pos-1);
QS(pos+1,R);
}
}