Logo Data Structures and Algorithms with Object-Oriented Design Patterns in C++
next up previous contents index

SwapContents Member Function

In addition to the inherited public interface, the LeftistHeap class definition includes the private member function SwapContents. This routine is used to implement the various operations on leftist heaps. The SwapContents routine takes a reference to another leftist heap node. The effect of the routine is to exchange the contents of ``this'' node with those of the given node. The implementation of SwapContents is trivial and the running time required is obviously O(1).


next up previous contents index

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