Skip to content

Commit 63db417

Browse files
committed
offer32
1 parent 41cd3c3 commit 63db417

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# 剑指Offer32. 从上到下打印二叉树II
2+
3+
从上到下按层打印二叉树,同一层的节点按从左到右的顺序打印,每一层打印到一行。
4+
5+
例如: 给定二叉树 `[3,9,20,null,null,15,7]`
6+
7+
```bash
8+
3
9+
/ \
10+
9 20
11+
/ \
12+
15 7
13+
```
14+
15+
返回:
16+
17+
```bash
18+
[
19+
[3],
20+
[9,20],
21+
[15,7]
22+
]
23+
```
24+
25+
**JavaScript题解**
26+
27+
使用 **BSF** 广度优先遍历。
28+
29+
```js
30+
31+
```
32+
33+
34+
35+
原题链接:https://leetcode-cn.com/problems/cong-shang-dao-xia-da-yin-er-cha-shu-lcof

0 commit comments

Comments
 (0)