Cover Data Structures and Algorithms with Object-Oriented Design Patterns in Java
next up previous contents index

Fields

Since a leftist heap is a heap-ordered binary tree, it inherits from the BinaryTree base class the three fields: key, left, and right. The key refers to the object contained in the given node and the left and right fields refer to the left and right subtrees of the given node, respectively. In addition, the field nullPathLength records the null path length of the given node. By recording the null path length in the node, it is possible to check the leftist heap balance condition in constant time.


next up previous contents index

Bruno Copyright © 1998 by Bruno R. Preiss, P.Eng. All rights reserved.