python創建二叉樹,經常使用遍歷的python實現

class Node(object): """ 定義樹節點類 """ def __init__ (self,x): self.val=x self.lchild=None self.rchild=None class Tree(object): """ 構造樹 """
相關文章
相關標籤/搜索