Регистрация | Вход в службу | FAQ      [?] 
CiteULike is a free online bibliography manager. Register and you can start organising your references online.
Recent | Unread | Search | Authors | Tags | Export

In situ, Stable Merging by Way of the Perfect Shuffle

by: John Ellis, Minko Markov
The Computer Journal, Vol. 43, No. 1. (1 January 2000), pp. 40-53.


View FullText article


X Reviews [Write a review of this article]

There are no reviews of this article

X Find related articles from these CiteULike users

X Find related articles with these CiteULike tags

X Abstract

We introduce a novel approach to the classical problem of the in situ, stable merging of lists, where in situ' means the use of no more than $O(\log^2 n)$ bits of extra memory for lists of size $n$. Our algorithm, Shufflemerge, reduces the merging problem to the problem of realizing the perfect shuffle' permutation, that is, the exact interleaving of two, equal length lists. The algorithm is recursive and so uses a logarithmic number of variables. Thus it uses more than absolutely minimum storage', i.e. $O(\log n)$ bits. A simple method of realizing the perfect shuffle uses one extra bit per element, and so is not in situ. We show that the perfect shuffle can be attained using absolutely minimum storage and in linear time, at the expense of doubling the number of moves, relative to the simple method. We note that there is a worst case for Shufflemerge requiring time $Ω(n \log n)$, where $n$ is the sum of the lengths of the input lists. We also present an analysis of a variant of Shufflemerge which uses a generalized shuffle and which has a provable average case time complexity of $O(n\log \log m)$, where $m$ is the length of the shortest input list. It is unlikely that the generalized shuffle can be achieved in situ. Linear time, in situ, stable merging has previously been demonstrated. We present experimental evidence indicating that Shufflemerge, although almost certainly not asymptotically linear, might be of value in practice. The relative simplicity of the basic method, particularly with respect to stability, also recommends it. 10.1093/comjnl/43.1.40


X BibTeX record

X RIS record



RIS BibTeX
CiteULike organises scholarly (or academic) papers or literature and provides bibliographic (which means it makes bibliographies) for universities and higher education establishments. It helps undergraduates and postgraduates. People studying for PhDs or in postdoctoral (postdoc) positions. The service is similar in scope to EndNote or RefWorks or any other reference manager like BibTeX, but it is a social bookmarking service for scientists and humanities researchers.