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.

[1]  Franco P. Preparata,et al.  Computational Geometry , 1985, Texts and Monographs in Computer Science.

[2]  Hsien-Kuei Hwang,et al.  On Convergence Rates in the Central Limit Theorems for Combinatorial Structures , 1998, Eur. J. Comb..

[3]  Béla Bollobás,et al.  Repeated Random Insertion into a Priority Queue , 1985, J. Algorithms.

[4]  Alfred V. Aho,et al.  The Design and Analysis of Computer Algorithms , 1974 .

[5]  Gaston H. Gonnet,et al.  Heaps on Heaps , 1982, ICALP.

[6]  Alan M. Frieze On the Random Construction of Heaps , 1988, Inf. Process. Lett..

[7]  Svante Carlsson,et al.  Average-case results on heapsort , 1987, BIT.

[8]  W. Szpankowski Average Case Analysis of Algorithms on Sequences , 2001 .

[9]  H. Noltemeier Dynamic Partial Orders and Generalized Heaps , 1990 .

[10]  V. V. Petrov Sums of Independent Random Variables , 1975 .

[11]  Bruce A. Reed,et al.  Building Heaps Fast , 1989, J. Algorithms.

[12]  Hsien-Kuei Hwang,et al.  The Cost Distribution of Queue-Mergesort, Optimal Mergesorts, and Power-of-2 Rules , 1999, J. Algorithms.

[13]  Hsien-Kuei Hwang,et al.  Limit theorems for mergesort , 1996, Random Struct. Algorithms.

[14]  Hsien-Kuei Hwang Asymptotic expansions of the mergesort recurrences , 1998, Acta Informatica.

[15]  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..

[16]  H. Mahmoud Sorting: A Distribution Theory , 2000 .

[17]  Robert Sedgewick,et al.  The Analysis of Heapsort , 1993, J. Algorithms.

[18]  John Haigh A neat way to prove asymptotic normality , 1971 .

[19]  Ernst-Erich Doberkat,et al.  An Average Case Analysis of Floyd's Algorithm to Construct Heaps , 1984, Inf. Control..

[20]  David Thomas,et al.  The Art in Computer Programming , 2001 .

[21]  Colin McDiarmid,et al.  Average Case Analysis of Heap Building by Repeated Insertion , 1991, J. Algorithms.

[22]  Donald E. Knuth,et al.  The Art of Computer Programming: Volume 3: Sorting and Searching , 1998 .