public static int getMidVal(int []num,int low,int high){
int mid=num[low];
while(low<high){
while(low<high&&num[high]>=mid){
--high;
}
num[low]=num[high];
while(low<high&&num[low]<=mid){
++low;
}
num[high]=num[low];
}
num[low]=mid;
return low;
}
public static void QuickSort(int []num,int low,int high){
if(low>=high){
return ;
}
int mid=getMidVal(num, low, high);
QuickSort(num, low, mid-1);
QuickSort(num, mid+1, high);
}