广度优先遍历:优先遍历兄弟节点,再遍历子节点 算法:通过队列实现-->先进先出 广度优先遍历的结果: 50,20,60,15,30,70,12 程序遍历这个二叉树: # encoding=utf-8from Queue import Queue class TreeNode(object): def __init__(self,val,left=None,right=None): self.val = val self.left = left self.right = right class B…