Graphs Advanced Checkpoint

Trace fresh cases, diagnose a failed invariant, then revisit the linked explanation and implementation.


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

1. Prerequisite edges 0→1, 1→2, 2→0 contain how many vertices in a directed cycle? Answer with the integer only.
2. Dijkstra settles a vertex under its usual proof. Which new input feature invalidates that proof?

Select one answer.

3. Kahn topological sorting processes only 4 of 6 vertices. What does this show?

Select one answer.

4. Edges S→A weight 7, S→B weight 2, B→A weight 3 give what shortest distance from S to A? Answer with the integer only.
5. A priority queue contains distance 9 for u, but dist[u] is already 4. What should a Dijkstra loop do with the stale entry?

Select one answer.

6. A course has two identical prerequisite pairs. Adjacency keeps both edges but indegree counts only one. What can fail?

Select one answer.

Join Discord