数据结构--Python实现
tianrandai12
这个作者很懒,什么都没留下…
展开
-
递归遍历二叉树
#二叉树结点 class BinaryTreeNode(object): def __init__(self): self.data='#' self.LeftChild=None self.RightChild=None #二叉树类,创建二叉树和遍历二叉树 class BinaryTree(object): def Create...原创 2020-02-08 21:50:15 · 196 阅读 · 0 评论 -
非递归遍历二叉树
#类名称:BinaryTreeNode #类说明:定义一个二叉树的结点 #类释义:分别有左孩子LeftChild,右孩子RightChild和数据data class BinaryTreeNode(object): def __init__(self): self.data='#' self.LeftChild=None self.Righ...原创 2020-02-08 21:48:16 · 180 阅读 · 0 评论