Optimizing stable in-place merging

  • Authors:
  • Jingchao Chen

  • Affiliations:
  • Department of Communication, Donghua University, 1882 Yan-an West Road, Shanghai, 200051, People's Republic of China

  • Venue:
  • Theoretical Computer Science
  • Year:
  • 2003

Quantified Score

Hi-index 5.23

Visualization

Abstract

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 + 12m1 + o(m1) moves, where m1 and m2 are the sizes of two ordered sublists to be merged, and m1 ≤ m2. This paper optimizes the algorithm. The optimized algorithm is simpler than their algorithm, and makes at most m1(t + 1) + m2/2t + o(m1 + m2) comparisons and 6m2 + 7m1 + o(m1 + m2) moves.