Stronger Quickheaps

The Quickheap (QH) is a recent data structure for implementing priority queues which has proved to be simple and efficient in practice. It has also been shown to offer logarithmic expected amortized complexity for all of its operations. Yet, this complexity holds only when keys inserted and deleted are uniformly distributed over the current set of keys. This assumption is in many cases difficult to verify, and does not hold in some important applications such as implementing some minimum spanning tree algorithms using priority queues. In this paper we introduce an elegant model called a Leftmost Skeleton Tree (LST) that reveals the connection between QHs and randomized binary search trees, and allows us to define Randomized QHs. We prove that these offer logarithmic expected amortized complexity for all operations regardless of the input distribution. We also use LSTs in connection to α-balanced trees to achieve a practical α-Balanced QH that offers worst-case amortized logarithmic time bounds for all the operations. Both variants are much more robust than the original QHs. We show experimentally that randomized QHs behave almost as efficiently as QHs on random inputs, and that they retain their good performance on inputs where that of QHs degrades.

[1]  Peter Sanders Fast Priority Queues for Cached Memory , 1999, ALENEX.

[2]  Peter Sanders,et al.  STXXL: standard template library for XXL data sets , 2008, Softw. Pract. Exp..

[3]  Gonzalo Navarro,et al.  On Sorting, Heaps, and Minimum Spanning Trees , 2010, Algorithmica.

[4]  Arne Andersson General Balanced Trees , 1999, J. Algorithms.

[5]  Manuel Blum,et al.  Time Bounds for Selection , 1973, J. Comput. Syst. Sci..

[6]  Charles E. Leiserson,et al.  Cache-Oblivious Algorithms , 2003, CIAC.

[7]  John D. Valois Introspective sorting and selection revisited , 2000 .

[8]  David R. Musser,et al.  Introspective Sorting and Selection Algorithms , 1997, Softw. Pract. Exp..

[9]  Robert E. Tarjan,et al.  Fibonacci heaps and their uses in improved network optimization algorithms , 1984, JACM.

[10]  Conrado Martínez,et al.  Randomized binary search trees , 1998, JACM.

[11]  Robert E. Tarjan,et al.  Self-Adjusting Heaps , 1986, SIAM J. Comput..

[12]  Robert E. Tarjan,et al.  Amortized efficiency of list update and paging rules , 1985, CACM.

[13]  R. Prim Shortest connection networks and some generalizations , 1957 .

[14]  Robert E. Tarjan,et al.  The pairing heap: A new form of self-adjusting heap , 2005, Algorithmica.

[15]  Jean Vuillemin,et al.  A data structure for manipulating priority queues , 1978, CACM.

[16]  Gerth Stølting Brodal,et al.  On the limits of cache-obliviousness , 2003, STOC '03.

[17]  Peter van Emde Boas,et al.  Design and implementation of an efficient priority queue , 1976, Mathematical systems theory.

[18]  Ingo Wegener BOTTOM-UP-HEAPSORT, a New Variant of HEAPSORT, Beating, on an Average, QUICKSORT (if n is not Very Small) , 1993, Theor. Comput. Sci..