2 research outputs found
A characterization of heaps and its applications
AbstractIn this paper we present a new view of a classical data structure, the heap. We view a heap on n elements as an ordered collection of ⌜log2(n + 1)⌝ substructures of sizes 2i with i in {0, …, ⌈log2(n)⌉}. We use the new view in the design of an algorithm for splitting a heap on n elements into two heaps on k and n − k elements, respectively. The algorithm requires O(log2(n)) comparisons, improving the previous bound of O(k) comparisons for all but small values of k, i.e., for k log2(n). We also present a new and conceptually simple algorithm for merging heaps of sizes n and k into one heap of size n + k in O(log(n) ∗ log(k)) comparisons
Recommended from our members
Proceedings of the Workshop on Algorithmic Aspects of Advanced Programming Languages: WAAAPL'99: Paris, France, September 30, 1999
The first Workshop on Algorithmic Aspects of Advanced Programming Languages was held on September 30, 1999, in Paris, France, in conjunction with the PLI'99 conferences and workshops. The choice of programming languages has a huge effect on the algorithms and data structures that are to be implemented in that language. Traditionally, algorithms and data structures have been studied in the context of imperative languages. This workshop considers the algorithmic implications of choosing an advanced functional or logic programming language instead. A total of eight papers were selected for presentation at the workshop, together with an invited lecture by Robert Harper. We would like to thank Dider Remv, general chair of PLI'99, for his assistance in organizing this workshop