Data Structures and Algorithms
with Object-Oriented Design Patterns in C# |
The Purge method for the BinaryTree class is defined in Program . 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).
Program: BinaryTree class Purge method.