public static int[] ShellInsert(int[] arr){ int step = arr.length/2; while(step >= 1){ for(int i=step;i<arr.length;i++){ int temp = arr[i]; int j = 0; for(j=i-step;j>=0 && temp<arr[j];j-=step){ arr[j+step] = arr[j]; } arr[j+step] = temp; } step /= 2; } return arr; }