z-logo
open-access-imgOpen Access
Optimal Stable Merging
Author(s) -
Antonios Symvonis
Publication year - 1995
Publication title -
the computer journal
Language(s) - English
Resource type - Journals
SCImago Journal Rank - 0.319
H-Index - 64
eISSN - 1460-2067
pISSN - 0010-4620
DOI - 10.1093/comjnl/38.8.681
Subject(s) - merge (version control) , computer science , algorithm , linear space , constant (computer programming) , mathematics , combinatorics , information retrieval , programming language
This paper shows how to stably merge two sequences A and B of sizes m and n, m ≤ n, respectively, with O(m + n) assignments, O(mlog(n/m + 1)) comparisons and using only a constant amount of additional space. This result matches all known lower bounds and closes an open problem posed by Dudzinski and Dydek in 1981. Our algorithm is based on the unstable algorithm of Mannila and Ukkonen. All techniques we use have appeared in the literature in more complicated forms but were never combined together. They are powerful enough to make stable all the existing linear in-place unstable algorithms we are aware of. We also present a stable algorithm that requires a linear number of comparisons and assignments which we consider to be the simplest algorithm for in-place merging.

The content you want is available to Zendy users.

Already have an account? Click here to sign in.
Having issues? You can contact us here
Accelerating Research

Address

John Eccles House
Robert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom