Mental Model
We find groups of nodes where each node can reach any other node in the same group by walking through edges. BFS helps explore all nodes connected to a starting node.
Analogy: Imagine a group of friends at a party. If you start talking to one friend and then meet all their friends, and their friends' friends, you find one connected group. BFS is like spreading the conversation to find everyone in that group.
Graph: 0 -> 1 | 2 3 -> 4 Connected components: Component 1: 0 -> 1 -> 2 Component 2: 3 -> 4
