This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BSTnode(object): | |
""" | |
Representation of a node in a binary search tree. | |
Has a left child, right child, and key value, and stores its subtree size. | |
""" | |
def __init__(self, parent, t): | |
"""Create a new leaf with key t.""" | |
self.key = t | |
self.parent = parent | |
self.left = None |