Graph Theory37 sections · 1633 units
Open in CourseQuiz: Island Counting Logic
Knowledge check
Check Your Understanding
In the Number of Islands problem, you iterate through every cell and launch DFS/BFS when you find an unvisited land cell. After one DFS call, what is true about the cells it visited?
- A.They form the largest island in the grid
- B.They include some water cells adjacent to the island
- C.They are exactly the land cells of one connected island
- D.They are all land cells in the grid