126. Binary Tree Level Order Traversal

Given the root of a binary tree root, return the node values level by level from left to right (breadth-first traversal).
Example 1
Input: root = [3,9,20,null,null,15,7]
Output: [[3],[9,20],[15,7]]
Explanation: Three levels: root, two nodes, two leaves.
Example 2
Input: root = [1]
Output: [[1]]
Explanation: One level with one node.
binary treemediumqueuetree
JavaScript
Loading...
Line 1, Char 1