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)
def _case1(self, node: Node):#removing root//terminating case if node is self.root: node.color = True return self._case2(node=node)