Python簡單前序建立二叉樹及二叉樹的遍歷

1、學習要點: 1.python中不能用結構體,C和C++實現二叉樹多用結構體,python中只用對象; 2、代碼實現:python class Tree(): def __init__(self,data=-1,lchild=None,rchild=None): self.data=data self.lchild=lchild self.rchild=rchild def Cr
相關文章
相關標籤/搜索