Skip to main content

Multiway In-Place Merging

  • Conference paper
Fundamentals of Computation Theory (FCT 2009)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 5699))

Included in the following conference series:

Abstract

We present an algorithm for asymptotically efficient k-way merging. Given an array A containing sorted subsequences A 1,...,A k of respective lengths n 1,...,n k , where \(\sum_{i=1}^{k}n_i = n\), our algorithm merges A 1,...,A k in-place, into a single sorted sequence, performing \(\lceil{\lg k}\rceil\!\cdot\!n + o(n)\) element comparisons and 3·n + o(n) element moves. That is, our algorithm runs in linear time, with the number of moves independent of k, the number of input sequences.

This work was supported by the Slovak Grant Agency for Science (VEGA) under contract 1/0035/09 .

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. Chen, J.: Optimizing Stable In-Place Merging. Theoret. Comput. Sci. 302, 191–210 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  2. Franceschini, G., Geffert, V.: An In-Place Sorting with \(O(n\!\cdot\!\lg n)\) Comparisons and O(n) Moves. J. Assoc. Comput. Mach. 52, 515–537 (2005)

    Article  MATH  Google Scholar 

  3. Geffert, V., Katajainen, J., Pasanen, T.: Asymptotically Efficient In-Place Merging. Theoret. Comput. Sci. 237, 159–181 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  4. Katajainen, J., Pasanen, T.: In-Place Sorting with Fewer Moves. Inform. Process. Lett. 70, 31–37 (1999)

    Article  MathSciNet  MATH  Google Scholar 

  5. Katajainen, J., Pasanen, T., Teuhola, J.: Practical In-Place Mergesort. Nordic J. Comput. 3, 27–40 (1996)

    MathSciNet  Google Scholar 

  6. Knuth, D.E.: The Art of Computer Programming, 2nd edn. Sorting and Searching, vol. 3. Addison-Wesley, Reading (1998)

    MATH  Google Scholar 

  7. Mannila, H., Ukkonen, E.: A Simple Linear-Time Algorithm for In Situ Merging. Inform. Process. Lett. 18, 203–208 (1984)

    Article  MathSciNet  Google Scholar 

  8. Wegener, I.: Bottom-Up-Heapsort, a New Variant of Heapsort Beating, on an Average, Quicksort (If n Is Not Very Small). Theoret. Comput. Sci. 118, 81–98 (1993)

    MATH  Google Scholar 

  9. Williams, J.W.J.: Heapsort (Algorithm 232). Comm. Assoc. Comput. Mach. 7, 347–348 (1964)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Geffert, V., Gajdoš, J. (2009). Multiway In-Place Merging. In: Kutyłowski, M., Charatonik, W., Gębala, M. (eds) Fundamentals of Computation Theory. FCT 2009. Lecture Notes in Computer Science, vol 5699. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-03409-1_13

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-03409-1_13

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-03408-4

  • Online ISBN: 978-3-642-03409-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics