Pessoal estou com duvida se o algoritmo abaixo estar correto;
sequencia de h = (4^k) + 3*( 2^k-1) +1;
private static void shellSort(long[] nums) {
int h = 1;
int n = nums.length;
while(h < n) {
h = (4^n) * 3 *(2^n-1+ 1);
}
h = h / 3;
long c;
int j;
while (h > 0) {
for (int i = h; i < n; i++) {
c = nums[i];
j = i;
while (j >= h && nums[j - h] > c) {
nums[j] = nums[j - h];
j = j - h;
}
nums[j] = c;
}
h = h / 2;
}