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.