0. 题目
1. deque()双端队列 实现 层序遍历bfs
class Solution(object):
def levelOrder(self, root):
# bfs:广度优先遍历
if not root: return []
parent = deque()
parent.append(root)
res = []
while parent:
tmp = []
n = len(parent)
for i in range(n):
p = parent.popleft()
tmp.append(p.val) # 要返回list<list>
if p.left: