Mental Model
We want to find the widest level in a tree, counting all nodes between the leftmost and rightmost nodes including gaps.
Analogy: Imagine a theater seating where some seats are empty. The width is the distance from the first occupied seat on the left to the last occupied seat on the right, counting empty seats in between.
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