Ratio based stable in-place merging

  • Authors:
  • Pok-Son Kim;Arne Kutzner

  • Affiliations:
  • Kookmin University, Department of Mathematics, Seoul, Korea;Seokyeong University, Department of Computer Science, Seoul, Rep. of Korea

  • Venue:
  • TAMC'08 Proceedings of the 5th international conference on Theory and applications of models of computation
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

We investigate the problem of stable in-place merging from a ratio k = n/m based point of view where m, n are the sizes of the input sequences with m ≤ n. We introduce a novel algorithm for this problem that is asymptotically optimal regarding the number of assignments as well as comparisons. Our algorithm uses knowledge about the ratio of the input sizes to gain optimality and does not stay in the tradition of Mannila and Ukkonen's work [8] in contrast to all other stable in-place merging algorithms proposed so far. It has a simple modular structure and does not demand the additional extraction of a movement imitation buffer as needed by its competitors. For its core components we give concrete implementations in form of Pseudo Code. Using benchmarking we prove that our algorithm performs almost always better than its direct competitor proposed in [6]. As additional sub-result we show that stable in-place merging is a quite simple problem for every ratio k ≥ √m by proving that there exists a primitive algorithm that is asymptotically optimal for such ratios.