예제 #1
0
 def _recolor(self, grandParent: Node):
     grandParent.left.color = True
     grandParent.right.color = True
     if grandParent is not self.root:
         grandParent.color = False
     else:
         grandParent.color = True
         self._fixInsert(grandParent)
예제 #2
0
 def _case1(self, node: Node):#removing root//terminating case
     if node is self.root:
         node.color = True
         return
     self._case2(node=node)