Sorting --- Shell's Sort

Steven J. Zeil

Old Dominion University, Dept. of Computer Science

Table of Contents

1. Shell's Sort and the Insertion Sort
2. Getting it (Almost) Right Early
3. Worst-Case Analysis of Shell's Sort with Shell's Increment Sequence
3.1. Shell's Sort is At Best O(n2)
3.2. Shell's Sort is No Worse than O(n2)
3.3. No Worse (Proof cont.)
3.4. Finishing Up
3.5. Shell's Sort is O(n2)
4. Other Increment Sequences

In an earlier lesson, we saw:

Theorem: Any sorting algorithm that only swaps adjacent elements has average time no faster than `O(n^{2})`.

So, if we want to sort in time faster than `O(n^{2})`, we can't do it by only swapping adjacent elements. The obvious way around this limitation is to compare and, when necessary, exchange distant objects.

The Shell sort (named for its inventor, Donald Shell) is an early and interesting attempt to do this.


In the Forum:

(no threads at this time)