Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root).
描述
层序遍历,自底向上
分析
自顶向下遍历,将新的一层插入到最前面,lists.add(0, arrayList)
代码
1 | /** |
Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root).
层序遍历,自底向上
自顶向下遍历,将新的一层插入到最前面,lists.add(0, arrayList)
1 | /** |