#include
#include
#include
void swap(int *a,int *b){
int temp=*a;
*a=*b;
*b=temp;
}
void insertSort(int a[],int n){
for(int i=1;i=0&&tempa[center]){
swap(&a[left],&a[center]);
}
if(a[left]>a[right]){
swap(&a[left],&a[right]);
}
if(a[center]>a[right]){
swap(&a[center],&a[right]);
}
swap(&a[center],&a[right-1]);
return a[right-1];
}
void quickSort(int a[],int left,int right){
if(left+5<=right){
int centerValue=getCenterValue(a,left,right);
int i=left;
int j=right-1;
while(1){
while(a[++i]centerValue){
}
if(i