Multiway in-place merging

  • Authors:
  • Viliam Geffert;Jozef Gajdoš

  • Affiliations:
  • Department of Computer Science, P. J. Šafárik University, Košice, Slovakia;Department of Computer Science, P. J. Šafárik University, Košice, Slovakia

  • Venue:
  • FCT'09 Proceedings of the 17th international conference on Fundamentals of computation theory
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present an algorithm for asymptotically efficient k-way merging. Given an array A containing sorted subsequences A1,...,Ak of respective lengths n1,...,nk, where Σi=1k ni = n, our algorithm merges A1,...,Ak in-place, into a single sorted sequence, performing ⌈ lg k ⌉ċ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.