Tight lower bounds for Shellsort
Shellsort is a simple classic algorithm that runs competitively on both mid-sized and nearly sorted files. It uses an increment sequence, the choice of which can drastically affect the algorithm's running time. Due to the results of Pratt, the running time of Shellsort was long thought to be Θ(N3/2) for increment sequences that are "almost geometric". However, recent results have lowered the upper bound substantially, although the new bounds were not known to be tight.
In this paper, we show that an increment sequence given by Sedgewick is Θ(N4/3) by analyzing the time required to sort a particularly bad permutation. Extending this proof technique to various increment sequences seems to lead to lower bounds that in general match the known upper bounds and suggests that Shellsort runs in Ω(N1 + ∈/→log N) for increment sequences of practical interest, and that no increment sequence exists that would make Shellsort optimal.
KeywordsEarly Pass Frobenius Function Frobenius Number General Permutation Tight Lower Bound
Unable to display preview. Download preview PDF.
- [Bra42]A. Brauer, "On a Problem of Partitions", American J Mathematics 64 (1942), 299–312.Google Scholar
- [Gon84]G. Gonnet, Handbook of Algorithms and Data Structures, Addison-Wesley, 1984.Google Scholar
- [Hib63]T.N. Hibbard, "An empirical study of minimal storage sorting", Communications of the ACM 6 5(1963), 206–213.Google Scholar
- [Inc85]J. Incerpi, "A Study of the Worst-Case of Shellsort", Ph.D. Thesis, Brown University, 1985.Google Scholar
- [InS83]J. Incerpi and R. Sedgewick, "Improved Upper Bounds on Shellsort", Proceedings 24th Annual Symposium on Foundations of Computer Science, Tucson 1983, 48–55.Google Scholar
- [Joh60]S.M. Johnson, "A linear diophantine problem", Canadian J. Math. 12 (1960), 390–398.Google Scholar
- [Knu73]D.E. Knuth, The Art of Computer Programming. Volume 3: Sorting and Searching, Addison-Wesley, Reading, Mass. (1973).Google Scholar
- [NiW72]A. Nijenhuis and H.S. Wilf, "Representations of integers by linear forms in nonnegative integers", J. Number Theory 4 (1972), 98–106.Google Scholar
- [PaS65]A.A. Papernov and G.V. Stasevich, "A method of information sorting in computer memories", Problems of Information Transmission 1 3(1965), 63–75.Google Scholar
- [Pra71]V. Pratt, Shellsort and Sorting Networks, Garland Publishing, New York (1979). (Originally presented as the author's Ph.D. thesis, Stanford University, 1971.)Google Scholar
- [Sed86]R. Sedgewick, "A New Upper Bound for Shellsort", J. of Algorithms 2 (1986), 159–173.Google Scholar
- [Sel77]E.S. Selmer, "On the linear diophantine problem of Frobenius", J. reine angew. Math. 294 (1977), 1–17.Google Scholar
- [Sel87]E.S. Selmer, "On Shellsort and the Frobenius problem", unpublished manuscript.Google Scholar
- [Sh884]W.J. Curran Sharp, Solution to Problem 7382 (Mathematics), Educational Times, London (1884).Google Scholar
- [She59]D.L. Shell, "A high-speed sorting procedure", Communications of the ACM 2 7(1959), 30–32.Google Scholar