UnShuffle sort


Definition: A distribution sort with two phases. In the first phase, the inputs are distributed among doubly-ended queues keeping the items in each queue ordered and creating a new queue when there is no place on an existing queue. The second phase is an ideal merge in which the item to be removed is determined by keeping the queues in a priority queue.

See also merge sort, distribution sort, ideal merge, pile.

Note: The doubly-ended queue with ordered items is called a pile. The UnShuffle algorithm is the most efficient available for sorting data streams that exhibit low entropy, i.e., are already mostly sorted or contains runs of sorted elements. The run time is upper-case Theta(N) for sorted input. The general case is (K/2)*N + NlogK where K is the entropy of the input and is manifest in the number of piles generated during the distribution phase.

First published in Art S. Kagel, Unshuffle Algorithm, Not Quite a Sort?, Computer Language Magazine, Vol. 3, No. 11, November 1985.

Author: ASK

Go to the Dictionary of Algorithms and Data Structures home page.

If you have suggestions, corrections, or comments, please get in touch with Paul E. Black  (paul.black@nist.gov).

Entry modified Mon Jun 7 13:46:39 1999.
HTML page formatted Thu Jan 31 13:51:46 2002.

This page's original URL is http://www.nist.gov/dads/HTML/unshufflsort.html