希尔算法
for (int step = array.length / 2; step > 0; step /= 2) { for (int i = step; i < array.length; i++) { int temp = array[i]; int j = i; while (j >= step && temp < array[j - step]) { array[j] = array[j - step]; j -= step; } array[j] = temp; } }
for (int step = array.length / 2; step > 0; step /= 2) { for (int i = step; i < array.length; i++) { int temp = array[i]; int j = i; while (j >= step && temp < array[j - step]) { array[j] = array[j - step]; j -= step; } array[j] = temp; } }