Abstract
We present a novel, yet straightforward linear-time algorithm for merging two sorted lists in a fixed amount of additional space. Constant of proportionality estimates and empirical testing reveal that this procedure is reasonably competitive with merge routines free to squander unbounded additional memory, making it particularly attractive whenever space is a critical resource.
- 1 Alanko, T.O., Erkio, H.H., and Haikala, l.J. Virtual memory behavior of some sorting algorithms. IEEE Trans. on Software Engr. 10 (1984), 422-431.Google ScholarDigital Library
- 2 Dvorak, S., and Durian, B. Towards an efficient merging. Lecture Notes in Computer Science 233 (1986), 290-298. Google ScholarDigital Library
- 3 Horvath, E.C. Stable sorting in asymptotically optima} time and extra space. J. of the ACM 25 (1978), 177-199. Google ScholarDigital Library
- 4 Huang, B.C., and Langston, M.A. Fast stable merging and sorting in constant extra space, Computer Science Department Technical Report CS-87-170, Washington State University, 1987.Google Scholar
- 5 Huang, B.C., and Langston, M.A. Stable duplicate-key extraction with optimal time and space hounds. Acta lnformatica, to appear. Google ScholarDigital Library
- 6 Huang, B.C., and Langston, M.A. Stable set and multiset operations in optimal time and space, Computer Science Department Technical Report CS-87-166, Washington State University, 1987.Google Scholar
- 7 Knuth, D.E. The Art of Computer Programming, Vol. 3: Sorting and Searching. Addison-Wesley, Reading, Mass., 1973. Google ScholarDigital Library
- 8 Kronrod, M.A. An optimal ordering algorithm without a field of operation (in Russian}, Dok. Akad. Nauk SSSR 186 (1969), 1256-1258.Google Scholar
- 9 Mannila, H., and Ukkonen, E. A simple linear-time algorithm for in situ merging. Information Processing Letters 18 (1984}, 2:03-208. Google ScholarDigital Library
- 10 Pardo, L.T. Stable sorting and merging with optimal space and time bounds. SIAM 1. Comput. 6 (1977), 351-372.Google Scholar
Index Terms
- Practical in-place merging
Recommendations
Practical in-place merging
ACM '87: Proceedings of the 1987 Fall Joint Computer Conference on Exploring technology: today and tomorrowWe present a novel, yet straightforward linear-time algorithm for merging two sorted lists in a fixed amount of additional space. Constant of proportionality estimates and empirical testing reveal that this procedure is reasonably competitive with merge ...
Multiway in-place merging
We present an algorithm for asymptotically efficient k-way merging. Given an array A containing k sorted subsequences A"1,...,A"k of respective lengths n"1,...,n"k, where @?"i"="1^kn"i=n, our algorithm merges A"1,...,A"k into a single sorted sequence in-...
Optimizing stable in-place merging
In 2000, Geffert et al. (Theoret. Comput. Sci. 237 (2000) 159) presented an asymptotically efficient algorithm for stable merging in constant extra space. The algorithm requires at most m1(t + 1) + m2/2t + o(m1) comparisons (t = ⌊log2(m2/m1)⌋) and 5m2 + ...
Comments