Data Structures and Algorithms
with Object-Oriented Design Patterns in JavaThe BinaryHeap class has a rather simple implementation. In particular, it requires only a single field, array, which is declared as an array of Comparable objects. This array is used to hold the objects which are contained in the binary tree. When there are n items in the heap, those items occupy array positions 1, 2, ..., n.
Copyright © 1998 by Bruno R. Preiss, P.Eng. All rights reserved.