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

Implementation

This section presents an implementation of leftist heaps that is based on the binary tree implementation described in Section gif. Program gif introduces the LeftistHeap class. The LeftistHeap class extends the BinaryTree class introduced in Program gif and it implements the MergeablePriorityQueue interface defined in Program gif.

   program25258
Program: LeftistHeap fields.




next up previous contents index

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