[prev] 38 [next]

ShellSort: Improving Insertion Sort (cont)

Effective sequences of h values have been determined empirically.

E.g. hi+i = 3hi+1 ... 1093, 364, 121, 40, 13, 4, 1

Efficiency of Shellsort:

  • depends on the sequence of h values
  • suprisingly, Shellsort has not yet been fully analysed
  • above sequence has been shown to be O(n3/2)
  • others have found sequences which are O(n4/3)