Mental Model
BFS explores all neighbors of a node before moving to the next level of nodes. It visits nodes layer by layer.
Analogy: Imagine you are in a building and want to visit every room floor by floor. You first visit all rooms on the first floor, then all rooms on the second floor, and so on.
Graph: 1 / \ 2 3 | | 4 5 Queue starts with [1] Visited set is empty
