SOFSEM 2006: Theory and Practice of Computer Science

Volume 3831 of the series Lecture Notes in Computer Science pp 350-359

On Optimal and Efficient in Place Merging

  • Pok-Son KimAffiliated withDepartment of Mathematics, Kookmin University
  • , Arne KutznerAffiliated withDepartment of E-Business, Seokyeong University

* Final gross prices may vary according to local VAT.

Get Access


We introduce a new stable in place merging algorithm that needs O(mlog\((\frac{n}{m}+1))\) comparisons and O(m+n) assignments. According to the lower bounds for merging our algorithm is asymptotically optimal regarding the number of comparisons as well as assignments. The stable algorithm is developed in a modular style out of an unstable kernel for which we give a definition in pseudocode.

The literature so far describes several similar algorithms but merely as sophisticated theoretical models without any reasoning about their practical value. We report specific benchmarks and show that our algorithm is for almost all input sequences faster than the efficient minimum storage algorithm by Dudzinski and Dydek. The proposed algorithm can be effectively used in practice.