Asymptotically efficient in-place merging

  • Jyrki Katajainen
  • Tomi Pasanen
  • George Titan
Contributed Papers Algorithms
Part of the Lecture Notes in Computer Science book series (LNCS, volume 969)


Two new linear-time algorithms for in-place merging are presented. Both algorithms perform at most (1 + t)m + n/22 + o(m) element comparisons, where m and n are the sizes of the input sequences, mn, and t = ILlog2(n/m)⌋. The first algorithm is for unstable merging and it carries out no more than 4(m + n) + o(n) element moves. The second algorithm is for stable merging and it accomplishes at most 15m + 13n + o(n) moves.


Input Sequence Binary Search Final Location Element Move Output Area 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Dudziński K., Dydek A., “On stable minimum storage merging algorithm”, Information Processing Letters 12 (1981) 5–8Google Scholar
  2. 2.
    Dvořák S., Ďurian B., “Towards an efficient merging”, Proc. of the 12th Symposium on Mathematical Foundations of Computer Science (1986) 290–298Google Scholar
  3. 3.
    Huang B-C., Langston M. A., “Practical in-place merging”, Communications of the ACM 31 (1988) 348–352CrossRefGoogle Scholar
  4. 4.
    Huang B-C., Langston M. A., “Fast stable merging and sorting in constant extra space”, Proc. of the 1st International Conference on Computing and Information (1989) 71–79Google Scholar
  5. 5.
    Hwang F. K., Lin S., “A simple algorithm for merging two disjoint linearly ordered sets”, SIAM Journal on Computing 1 (1972) 31–39Google Scholar
  6. 6.
    Katajainen J., Pasanen T., Teuhola J., “Practical in-place mergesort”, TR 94/1, Department of Computer Science, University of Copenhagen, Denmark (1994)Google Scholar
  7. 7.
    Knuth D. E., The Art of Computer Programming Vol. 3: Sorting and Searching, 2nd Printing, Addison-Wesley (1975)Google Scholar
  8. 8.
    Kronrod M. A., “Optimal ordering algorithm without operational field”, Soviet Math. Dokl. 10 (1969) 744–746Google Scholar
  9. 9.
    Mannila H., Ukkonen E., “A simple linear-time algorithm for in situ merging”, Information Processing Letters 18 (1984) 203–208MathSciNetGoogle Scholar
  10. 10.
    Munro J. I., Raman V., “Sorting with minimum data movement”, Journal of Algorithms 13 (1992) 374–393Google Scholar
  11. 11.
    Pardo L. T., “Stable sorting and merging with optimal space and time bounds”, SIAM Journal on Computing 6 (1977) 351–372Google Scholar
  12. 12.
    Pasanen T., “Lajittelu minimitilassa”, M.Sc. Thesis T-93-3, Department of Computer Science, University of Turku, Finland (1993)Google Scholar
  13. 13.
    Raman V., “Sorting in-place with minimum data movement”, Ph.D. Thesis CS-91-12, Computer Science Department, University of Waterloo, Ontario (1991)Google Scholar
  14. 14.
    Salowe J. S., Steiger W. L., “Simplified stable merging tasks”, Journal of Algorithms 8 (1987) 557–571Google Scholar
  15. 15.
    Symvonis A., “Optimal Stable Merging”, Proc. of the 6th International Conference on Computing and Information (1994) 124–143Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1995

Authors and Affiliations

  • Jyrki Katajainen
    • 1
  • Tomi Pasanen
    • 2
  • George Titan
    • 1
  1. 1.Department of Computer ScienceUniversity of CopenhagenCopenhagen EastDenmark
  2. 2.Department of Computer ScienceUniversity of TurkuTurkuFinland

Personalised recommendations