yly
yly
maybe not ``` python def print_tree(node: RedBlackTree): rt = ['---'] def util(nd: RedBlackTree, indent: int): if nd.right: util(nd.right, indent+4) text = '%s%s%s' % (indent*" ", ['b', 'r'][nd.color], nd.label) rt.append(text) if...
maybe you need a root refer 算法导论 ``` python class TreeManage: nil = None def __init__(self, cls) -> None: self.name = cls.__name__ self.nil: TreeBase = cls(None, None, self) self.nil.set_color_black() self.root:...
``` from typing import List from common import function class TreeBase: RED = 1 BLACK = 0 def __init__(self, val, parent, manage) -> None: self.val = val self.parent: TreeBase =...