Graph General — Reasoning Check

Choose the correct graph model for components, dependencies, ratios, and copying.


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

1. Surrounded Regions uses four-direction connectivity. For the six board rows XXXXXX / XOOXXX / XXOXXX / XXXOOX / XXXXOX / XXXXOX, how many O cells become X?
2. An undirected graph has edges A–B, A–C, B–D, and C–D. A clone reaches D first through B and later through C. What must the second encounter do?

Select one answer.

3. There are six courses 0..5 with prerequisite edges 0→1, 1→2, 3→4, and 4→3. Course 5 is isolated. Kahn’s algorithm emits four courses before the queue empties. What should FindOrder return?

Select one answer.

4. The consistent equations are p/q=4, q/r=0.5, and r/s=4. What is s/p? Enter an exact decimal.
5. A directed prerequisite graph has edges 0→1, 0→2, and 1→2. Union-find says the endpoints of the last edge are already connected. What does that establish?

Select one answer.

6. Number of Islands uses only horizontal and vertical neighbors. How many islands are in rows 10101 / 00100 / 11101?
Join Discord