python创建二叉树,经常使用遍历的python实现

class Node(object): """ 定义树节点类 """ def __init__ (self,x): self.val=x self.lchild=None self.rchild=None class Tree(object): """ 构造树 """
相关文章
相关标签/搜索