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 water or land, and connected means horizontally or vertically adjacent. BFS (Breadth-First Search) and DFS (Depth-First Search) are two ways to explore these groups to count them.
Why it matters
This problem helps understand how to explore connected parts in a grid, which is common in maps, games, and image processing. Without this, we couldn't easily find separate regions or clusters in data, making many applications inefficient or impossible.
Where it fits
You should know basic arrays and loops before this. After this, you can learn graph traversal algorithms, advanced grid problems, and connected components in graphs.