I want to modify QuickSort (in Java) so that every time Partition is called, the median of the proportioned array is used as the pivot.
I have a median selection algorit
You can use this ...
int Select(int array[],int start, int end,int k){
if(start==end){
return start;
}
int x=array[end];
int i=start-1;
for(int j=start;j<=end-1;j++){
if(array[j]k){
return Select(array,start,i-1,k);
}
else{
return Select(array,i+1,end,k);
}
}
Select will partition array on kth smallest element in array;