Overview - Number of Islands BFS and DFS
What is it?
Number of Islands is a problem where you count how many separate groups of connected 'land' cells exist in a grid. Each cell can be either land or water. We use BFS (Breadth-First Search) or DFS (Depth-First Search) to explore and mark connected land cells as one island.
Why it matters
This problem helps us understand how to explore connected parts in a grid, which is common in maps, games, and network analysis. Without this, we couldn't easily find or count connected regions, making tasks like flood fill, cluster detection, or pathfinding much harder.
Where it fits
Before this, you should know basic arrays and loops. After this, you can learn graph traversal algorithms more deeply, like shortest path or cycle detection, and apply these ideas to complex grid or graph problems.
