Graph Theory37 sections · 1633 units
Open in Course

Quiz: 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?

  1. A.They form the largest island in the grid
  2. B.They include some water cells adjacent to the island
  3. C.They are exactly the land cells of one connected island
  4. D.They are all land cells in the grid
Start the roadmap to answer the quizzes and solve the challenges