// 3 implement the function : int part(int *a,int low,int high), and implement the function to find the k-st num in a array
a[low] as the pivot element
int part(int *a,int low,int high){
int temp = a[low];
int i = low ;
for(int j=low+1;j<=high;j++){
if(a[j] <= temp){
i++;
exchange(a[i],a[j]);
}
}
exchange(a[i],a[low]);
return i;
}
int find_k_st(int *a,int start,int end){
if(start < end){
int mid = part(a,start,end);
if(mid == k-1)
return a[mid];
else{
if(k-1 < mid)
find_k_st(a,start,mid-1);
else
find_k_st(a,mid+1,end);
}
}
}