![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
编程练习3
陈小q
这个作者很懒,什么都没留下…
展开
-
Python:如何把一个有序整数数组放到二叉树中
class BiTNode: def __init__(self): self.data = None self.lchild = None self.rchild = None def arraytotree(arr, start, end): if end>=start: root = Bi...原创 2019-08-15 20:53:58 · 503 阅读 · 0 评论 -
Python:如何从顶部开始逐层打印二叉树节点数据
from collections import dequeclass BiTNode: def __init__(self): self.data = None self.lchild = None self.rchild = None def arraytotree(arr, start, end): if e...原创 2019-08-15 21:13:28 · 253 阅读 · 0 评论 -
Python:如何判断一个数组是否是二元查找树后序遍历的结果
def IsAfterOrder(arr, start, end): if arr == None: return False root = arr[end] i = start while i<end : if arr[i]>root: break i += 1 j = i...原创 2019-08-15 22:00:36 · 220 阅读 · 0 评论 -
Python:如何对二叉树进行镜像翻转
from collections import dequeclass BiTNode: def __init__(self): self.data = None self.lchild = None self.rchild = Nonedef reverseTree(root): if root == None: ...原创 2019-08-15 22:18:11 · 452 阅读 · 0 评论