int partition(int A[],int start , int end ,int pivot_ind){
int pivot = A[pivot_ind] ;
swap(A[pivot_ind],A[end]);
int ind = start;
for(int i = start;i < end;i++){
if(A[i]<pivot ){
swap(A[i],A[ind++]);
}
}
swap(A[ind],A[end]);
return ind;
}
void qSort(int A[],int start,int end ){
if(start >= end){
return;
}
int pivot_ind = start;
int mid = partition( A,start,end,pivot_ind);
qSort( A, start,mid-1 );
qSort( A, mid+1 , end );
}
int pivot = A[pivot_ind] ;
swap(A[pivot_ind],A[end]);
int ind = start;
for(int i = start;i < end;i++){
if(A[i]<pivot ){
swap(A[i],A[ind++]);
}
}
swap(A[ind],A[end]);
return ind;
}
void qSort(int A[],int start,int end ){
if(start >= end){
return;
}
int pivot_ind = start;
int mid = partition( A,start,end,pivot_ind);
qSort( A, start,mid-1 );
qSort( A, mid+1 , end );
}