Summary: Order 10:31-36, 1993, 31
© 1993KtuwerAcademic Publishers. Printed in the Netherlands.
M. D. ATKINSON
Department of Mathematical and Computational Sciences, North Haugh, St. Andrews, Fife KY16
Communicated by iV. Zaguia
(Received: 10 November 1992; accepted: 20 March 1993)
Abstract. A priority queue transforms an input sequence ~r into an output sequence r which is a
re-ordering of the sequence ~r. The set R of all such related pairs is studied in the case that tr is a
binary sequence. It is proved that R is a partial order and that IRI = c,~+1,the (n + 1)thCatalan
number, An efficient (O(n2)) algorithm is given for computing the number of outputs achievable
from a given input.
Mathematics Subject Classification(1991). 06A06.
Key words: Priority queue, binary sequence, enumeration.
Abstract data types are a fundamental design tool in modern software systems.
Although there is an infinity of possible data types there is a small number only
of them which recur frequently in algorithm design (stacks, arrays, queues, dic-