shell sort c 2b 2b

Solutions on MaxInterview for shell sort c 2b 2b by the best coders in the world

showing results for - "shell sort c 2b 2b"
Davin
16 Oct 2020
1C/C++/Java
21  gap = X;
32  do
43  { ok = 1;
54  for (i = 1; i<= N – gap; i++)
65    if (A[i] > A[i+gap])
76    {  temp = A[i];
87       A[i] = A[i+gap];
98       A[i+gap] = temp;
109       ok = 0;
1110   }
1211 if (gap/2 > 1) gap=gap/2; else gap=1;
1312 } while (ok == 0);