Graph #01
Medium Number of Islands
Count how many connected land components appear in a binary grid.
Solved graphdfsconnected components
Connectivity, traversal, components, and graph state propagation. The focus here is DFS, BFS, and component thinking. Official LeetCode problems are linked on every page instead of being mirrored here.
Every page keeps the problem summary, recognition pattern, reasoning, pitfalls, and the exact C++ source used on the site.
Count how many connected land components appear in a binary grid.