Shell sort



Definition: Compare an element with one h steps away - on each pass h sets of n/h items are sorted, typically with insertion sort. On each succeeding pass, h is reduced until it is 1 for the last pass. A good series of h values is important for efficiency.

http://www.nist.gov/dads/HTML/shellsort.html
http://www.iti.fh-flensburg.de/lang/algorithmen/sortieren/shell/shellen.htm





Shell Sort

OriginalArray 81 94 11 96 12 35 17 95 28 58 41 75 15
After 5-Sort 35 17 11 28 12 41 75 15 96 58 81 94 95
After 3-Sort 28 12 11 35 15 41 58 17 94 75 81 96 95
After 1-Sort 11 12 15 17 28 35 41 58 75 81 94 95 96