def remove(self, key): newroot = BalancedBSTNode.remove(self, key) return newroot.rebalance() if newroot else None
def put(self, key, value): newroot = BalancedBSTNode.put(self, key, value) return newroot.splayup(key)
def put(self, key, value): newroot = BalancedBSTNode.put(self, key, value) return newroot.rebalance()
def __init__(self, key, value): BalancedBSTNode.__init__(self, key, value) self._updateheight()