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, and connected means horizontally or vertically adjacent. BFS (Breadth-First Search) and DFS (Depth-First Search) are two ways to explore these connected groups to count them.
Why it matters
This problem helps us understand how to explore connected areas in grids, which is useful in maps, games, and image processing. Without this, we couldn't easily find or count clusters in data, making many applications inefficient or impossible.
Where it fits
Before this, you should know basic arrays and how to traverse them. After this, you can learn more complex graph algorithms and grid-based problems like shortest path or maze solving.
