Skip to content

Commit 48b83d2

Browse files
authored
Update 102.binary-tree-level-order-traversal.md
1 parent dcce58a commit 48b83d2

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

problems/102.binary-tree-level-order-traversal.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,20 @@ https://leetcode.com/problems/binary-tree-level-order-traversal/description/
44

55
## 题目描述
66
```
7-
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).
7+
给你一个二叉树,请你返回其按 层序遍历 得到的节点值。 (即逐层地,从左到右访问所有节点)。
8+
9+
 
10+
11+
示例:
12+
二叉树:[3,9,20,null,null,15,7],
813
9-
For example:
10-
Given binary tree [3,9,20,null,null,15,7],
1114
3
1215
/ \
1316
9 20
1417
/ \
1518
15 7
16-
return its level order traversal as:
19+
返回其层次遍历结果:
20+
1721
[
1822
[3],
1923
[9,20],
@@ -223,6 +227,14 @@ class Solution:
223227
return result
224228
```
225229

230+
***复杂度分析***
231+
- 时间复杂度:$O(N)$
232+
- 空间复杂度:$O(N)$
233+
234+
更多题解可以访问我的LeetCode题解仓库:https://github.com/azl397985856/leetcode 。 目前已经30K star啦。
235+
236+
大家也可以关注我的公众号《脑洞前端》获取更多更新鲜的LeetCode题解
237+
226238
## 相关题目
227239
- [103.binary-tree-zigzag-level-order-traversal](./103.binary-tree-zigzag-level-order-traversal.md)
228240
- [104.maximum-depth-of-binary-tree](./104.maximum-depth-of-binary-tree.md)

0 commit comments

Comments
 (0)