public static void shel(int arr[]){
int len = arr.length;
int k = len / 2;
while(k > 0){
for(int i = k; i < len; i++){
int n = arr[i];
int j = i-k;
while(j >= 0 && arr[j] > n){
arr[j+k] = arr[j];
j = j - k;
}
arr[j+k] = n;
}
k /= 2;
}
}
int len = arr.length;
int k = len / 2;
while(k > 0){
for(int i = k; i < len; i++){
int n = arr[i];
int j = i-k;
while(j >= 0 && arr[j] > n){
arr[j+k] = arr[j];
j = j - k;
}
arr[j+k] = n;
}
k /= 2;
}
}