For [3,9,20,null,null,15,7], what is the output?
Practice this question from Binary Tree Level Order Traversal - BFS queue Pattern Practice Quiz, with options and an explanation.
Question
For [3,9,20,null,null,15,7], what is the output?
Option A — Correct answer
[[3],[9,20],[15,7]]
Option B
[3,9,20,15,7]
Option C
[[15,7],[9,20],[3]]
Option D
[]
Explanation
The output is [[3],[9,20],[15,7]].