public static void shellSort(int[] a){
int len=a.length;
int i,j;
int h;
int temp;
for(h=len/2;h>0;h=h/2){
for(i=h;i<len;i++){
temp=a[i];
for(j=i-h;j>=0;j=j-h){
if(temp<a[j]){
a[j+h]=a[j] ;
}
else
break;
}
a[j+h]=temp;
}
}
}
int len=a.length;
int i,j;
int h;
int temp;
for(h=len/2;h>0;h=h/2){
for(i=h;i<len;i++){
temp=a[i];
for(j=i-h;j>=0;j=j-h){
if(temp<a[j]){
a[j+h]=a[j] ;
}
else
break;
}
a[j+h]=temp;
}
}
}