block by bmershon d02e4c0f0f2220075ecd

Shellsort II

Full Screen

An improvement upon a previous presentation of Shellsort. Here, each color indicates the elements which may be swapped during a given iteration of Shellsort.

The number of colors converges to 1 by following a sequence generated by the following code:

  while (h < N/3) h = 3*h + 1;

  ...

  //in the main loop

  h = h/3

index.html

shellsort.js