def _delete_node_with_one_child(self, M): C = M.l or M.r assert(M.color is BLACK) if C.color is RED: C.color = BLACK BinarySearchTree._delete_node_with_one_child(self, M)
def _delete_node_with_one_child(self, n): par = n.parent BinarySearchTree._delete_node_with_one_child(self, n) self._rebalance_till_root(par)