Problem
Return the level-order traversal of a binary tree's values as a list of lists.
References
Difficulty
🟡 Medium
Companies
Amazon, Google, Goldman Sachs
Notes
Language: Java
Track level size at each iteration using queue.size() before the inner loop.
Problem
Return the level-order traversal of a binary tree's values as a list of lists.
References
Difficulty
🟡 Medium
Companies
Amazon, Google, Goldman Sachs
Notes
Language: Java
Track level size at each iteration using queue.size() before the inner loop.