On the Number of Heaps and the Cost of Heap Construction
Heaps constitute a well-known data structure allowing the implementation of an efficient O(n log n) sorting algorithm as well as the design of fast priority queues. Although heaps have been known for long, their combinatorial properties are still partially worked out: exact summation formulae have been stated, but most of the asymptotic behaviors are still unknown. In this paper, we present a number of general (not restricting to special subsequences) asymptotic results that give insight on the difficulties encountered in the asymptotic study of the number of heaps of a given size and of the cost of heap construction. In particular, we exhibit the influence of arithmetic functions in the apparently chaotic behavior of these quantities and study their extremal and average properties. It is also shown that the distribution function of the cost of heap construction using Floyd’s algorithm and other variants is asymptotically normal.
KeywordsAsymptotic Normality Priority Queue Average Order Sorting Algorithm Probability Generate Function
Unable to display preview. Download preview PDF.
- E. E. Doberkat, An average case analysis of Floyd’s algorithm to construct heaps Information and Control 61 (1984) 114–131.Google Scholar
- J. M. Hammersley and G. R. Grimmett, Maximal solutions of the generalised subadditive inequality, in Chapter 4 of “Stochastic Geometry” Ed. by E. F. Harding and D. G. Kendall, John Wiley and Sons, 1974.Google Scholar
- H.-K. Hwang, On the solutions of some divide-and-conquer recurrences, Rapport de Recherche, LIX/RR/93/01, Ecole Polytechnique, 1993.Google Scholar
- H.-K. Hwang and J.-M. Steyaert, On the number of heaps and the cost of heap construction, full version available via the link http://algo.stat.sinica.edu.tw.html.
- D. E. Knuth, The Art of Computer Programming, Volume III—Sorting and Searching, Addison-Wesley, Second Edition, 1998.Google Scholar
- K. Mehlhorn and A. Tsakalidis, Data structures, Chapter 6 of Handbook of Theoretical Computer Science pp. 301–341, Edited by J. van Leeuwen, Elsevier Science Publishers, Amsterdam, 1990.Google Scholar
- T. Porter and I. Simon, Random insertion into a priority queue structure IEEE Transactions on Software Engineerings SE-1 (1975) 292–298.Google Scholar
- R. Sprugnoli, Recurrence relations on heaps Algorithmica 15 (1996), 467–480.Google Scholar
- J. W. J. Williams, Algorithm 232: Heapsort Communications of the ACM 7 (1964) 347–348.Google Scholar