Fast stable in-place sorting with O(n) data moves
Until recently, it was not known whether it was possible to stably sort (Le. keeping equal elements in their initial order) an array of n elements using only O(n) data movements and O(1) extra space. In , an algorithm was given to perform this task in O(n2) comparisons in the worst case. Here, we develop a new algorithm for the problem that performs only O(n1+ε) comparisons (0<ε<1 is any fixed constant) in the worst case. This bound on the number of comparisons matches (asymptotically) the best known bound for the same problem with the stability constraint dropped.
KeywordsData Movement Binary Search Extra Space Final Block Stable Version
Unable to display preview. Download preview PDF.
- B. C. Huang and M. A. Langston, Fast Stable Merging and Sorting in Constant Extra Space, Computing and Information, (1989), 71–79.Google Scholar
- D. E. Knuth, The Art of Computer Programming. Volume III: Sorting and Searching, Addison-Wesley (1973).Google Scholar
- M. A. Kronrod, Optimal Ordering Algorithm without Operational Field, Soviet Math. Dokl. 10 (1969) 744–746.Google Scholar
- T. W. Lai and D. Wood, Implicit Selection, Proceedings of the Scandinavian Workshop on Algorithm Theory, Lecture Notes in Computer Science 318, Springer Verlag, (1988) 14–23.Google Scholar
- J. I. Munro and V. Raman, Sorting with Minimum Data Movement, Proceedings of Workshop on Algorithms and Data Structures, Ottawa, Lecture Notes in Computer Science, Springer Verlag 382 (1989) 552–562; (revised version to appear in Journal of Algorithms)Google Scholar
- J. I. Munro and V. Raman, Selection in Read-Only Memory and Sorting with Optimum Data Movement, submitted for publication.Google Scholar
- J. I. Munro, V. Raman and J. S. Salowe, Stable In Situ Sorting and Minimum Data Movement, BIT 30 (1990) 220–234.Google Scholar
- V. Raman, Sorting In-Place with Minimum Data Movement, Ph.D. Thesis, Technical Report CS 91-12, Department of Computer Science, University of Waterloo (1991).Google Scholar
- J. W. J. Williams, Algorithm 232, Heapsort, Communications of the ACM, 7 (1964) 347–348.Google Scholar