Data Structures and Algorithms with Object-Oriented Design Patterns in Python
next up previous 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 the abstract MergeablePriorityQueue class defined in Program gif.

   program25510
Program: LeftistHeap class __init__ method.




next up previous index

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