Connected Components & Flood Fill
Count islands and label regions.
What a Component Is
A connected component is a group of nodes you can all reach from one another. A graph can hold several separate groups. 🧩
Counting Components
To count components, run a traversal from every unvisited node. Each fresh start marks one whole new group.
All lessons in this course
- Adjacency Lists from Input
- BFS for Shortest Unweighted Paths
- DFS, Recursion & Iterative Stacks
- Connected Components & Flood Fill