A simple linear-time algorithm for in situ merging
Information Processing Letters
Programming pearls (2nd ed.)
Asymptotically efficient in-place merging
Theoretical Computer Science
Optimizing stable in-place merging
Theoretical Computer Science
On optimal and efficient in place merging
SOFSEM'06 Proceedings of the 32nd conference on Current Trends in Theory and Practice of Computer Science
Hi-index | 0.00 |
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.