示例#1
0
 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)
示例#2
0
 def _delete_node_with_one_child(self, n):
     par = n.parent
     BinarySearchTree._delete_node_with_one_child(self, n)
     self._rebalance_till_root(par)