Binary Tree Level Order Traversal
Medium
LC #102
bfsqueueNot attempted yet
Given the root of a binary tree, return its values
level by level: a list of rows, top to bottom, each row
listed left to right.
Example 1
Input: root = [3, 9, 20, None, None, 15, 7]
Output: [[3], [9, 20], [15, 7]]
Example 2
Input: root = [1]
Output: [[1]]
Example 3
Input: root = []
Output: []
Constraints
- 0 ≤ number of nodes ≤ 2 · 10^4
- -10^5 ≤ Node.val ≤ 10^5