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 m 1( t+1)+ m 2/2 t +o( m 1) comparisons ( t=⌊log 2( m 2/ m 1)⌋) and 5 m 2+12 m 1+o( m 1) moves, where m 1 and m 2 are the sizes of two ordered sublists to be merged, and m 1⩽ m 2. This paper optimizes the algorithm. The optimized algorithm is simpler than their algorithm, and makes at most m 1( t+1)+ m 2/2 t +o( m 1+ m 2) comparisons and 6 m 2+7 m 1+o( m 1+ m 2) moves.
Published Version
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have