```
class ShellSort{
public void sortShell(int arr[]){
int n = arr.length;
int i,j,step;
for(step=n/2; step>0; step/=2){
for(i=step; i<n/2; i++){
int temp = arr[i];
for(j=i; j>=step && arr[j-step]<temp; j-=step){
arr[j] = arr[j-step];
}
arr[j] = temp;
}
}
for(step=n; step>n/2; step/=2){
for(i=step; i<n; i++){
int temp = arr[i];
for(j=i; j>=step && arr[j-step]>temp; j-=step){
arr[j] = arr[j-step];
}
arr[j] = temp;
}
}
}
public void printShellSort(int arr[]){
int n = arr.length;
System.out.println("\nShell Sort: ");
for(int i=0; i<n; i++){
System.out.print(arr[i]+"\t");
}
}
}
```