Mental Model
We find groups of nodes where each node can reach every other node in the same group by walking through edges. BFS helps explore each group fully before moving to the next.
Analogy: Imagine a party where people hold hands forming groups. BFS is like starting from one person and walking through their hand-holding friends until you find everyone in that group before moving to another group.
Graph: 0 -> 1 ā ā 2 3 Groups: Group 1: 0 -> 1 -> 3 -> 2 Group 2: 4 0 -> 1 -> 3 -> 2 -> null 4 -> null
