OPTIMAL STABLE MERGING

Authors
Citation
A. Symvonis, OPTIMAL STABLE MERGING, Computer journal, 38(8), 1995, pp. 681-690
Citations number
18
Categorie Soggetti
Computer Sciences","Computer Science Hardware & Architecture
Journal title
ISSN journal
00104620
Volume
38
Issue
8
Year of publication
1995
Pages
681 - 690
Database
ISI
SICI code
0010-4620(1995)38:8<681:OSM>2.0.ZU;2-3
Abstract
This paper shows how to stably merge two sequences A and B of sizes m and n, m less than or equal to n, respectively, with O(m + n) assignme nts, O(mlog(n/m + 1)) comparisons and using only a constant amount of additional space. This result matches all known lower bounds and close s an open problem posed by Dudzinski and Dydek in 1981. Our algorithm is based on the unstable algorithm of Mannila and Ukkonen. All techniq ues we use have appeared in the literature in more complicated forms b ut were never combined together. They are powerful enough to make stab le all the existing linear in-place unstable algorithms we are aware o f. We also present a stable algorithm that requires a linear number of comparisons and assignments which we consider to be the simplest algo rithm for in-place merging.