@MISC{_implicitheaps, author = {}, title = {Implicit Heaps}, year = {} }
Bookmark
OpenURL
Abstract
These notes discuss the classic implicit heap data structure [1, 2]. A heap (or priority queue) is a data structure that contains a set of items, each with a realvalued key, and that supports (at least) the following operations: • make-heap: return a new, empty heap. • insert(x, H): insert item x, with predefined key, into heap H. • find-min(H): return an item in heap H of minimum key. • delete-min(H): delete from heap H an item of minimum key, and return it; return null if the heap is empty. An implicit heap is an implementation of a heap consisting of a complete binary tree whose nodes contain the heap items, one node per item. The items are arranged in heap order: every node contains an item with a key no smaller than the key of the item in its parent, if it has a parent. Thus the root contains an item of minimum key, so a find-min takes O(1) time. We number the nodes level-by-level: the root is node 1, its children are nodes 2 and 3, the children