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

Purge Method

The Purge method for the BinaryTree class is defined in Program gif. The purpose of the Purge method is to make the tree empty. It does this by assigning null to all the fields. Clearly, the running time of the Purge method is O(1).

   program16533
Program: BinaryTree class Purge method.


next up previous contents index

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