Home
Topics
Practice
Roadmap
DSA Tracker
Code Editor
Tech Blogs
More
Sign in
Get started
Loading question...
Feedback
Binary Tree Level Order Traversal
Medium
00:00
0 users online
Share
Description
Solution
Submissions
Discussion
Given the root of a binary tree, return the level order traversal of its nodes' values.
Sample Input:
[3,9,20,null,null,15,7]
Sample Output:
[[3],[9,20],[15,7]]
Hints
Hint 1
Use breadth-first search with a queue
Hint 2
Process one level at a time
Hint 3
Track the number of nodes at each level
Code Editor
Reset
Run
Save
Loading...