Level Order Traversal
Given a binary tree root
return a level order traversal of the node values.
Constraints
n ≤ 100,000
wheren
is the number of nodes inroot
https://binarysearch.com/problems/Level-Order-Traversal
Examples
Example 1
Input
- root =
Output
- answer =
[0, 1, 2, 3]
Example 2
Input
- root =
Output
- answer =
[0, 5, 9, 1, 3, 4, 2]
Example 3
Input
- root =
Output
- answer =
[0, 1, 2, 3]
Leave a comment