Graph Traversal Basics

Work fresh traces, diagnose invalid implementations, and identify model boundaries.


Get every question correct to pass this checkpoint. You can review feedback, revise your answers, and submit again.

1. With four-neighbor connectivity, how many islands are in rows "10" and "01"?
2. Flood fill starts on color 7 and the requested color is also 7. A routine uses the new color as its only visited marker. What repair avoids repeated visits?

Select one answer.

3. A BFS marks nodes only when dequeued. Two parents both discover the same child first. What is the likely consequence?

Select one answer.

4. In an unweighted path A-B-C-D, how many edges are in the shortest path from A to D?
5. A grid traversal mutates visited land to water. What must a caller know before rerunning it on the same grid?

Select one answer.

Join Discord