Mental Model
We want to find the widest level in a tree by counting nodes between the leftmost and rightmost nodes at each level, including gaps.
Analogy: Imagine a tree as a family photo where some people are missing. The width is the distance from the first person on the left to the last person on the right, counting empty spots too.
1
/ \
3 2
/ \
5 9
/ \
6 7
Levels:
Level 0: 1
Level 1: 3 -> 2
Level 2: 5 -> null -> null -> 9
Level 3: 6 -> null -> null -> null -> null -> null -> null -> 7