Skip to main content

Graphs Quiz

Editorial

16 questions across the five Graphs lessons and the section's problems: degrees, the two stores and a grid as a graph; DFS and BFS orders, islands and a fill too deep to recurse; fewest steps from many starts, through states and past obstacles; cycles, two colours and Kahn's order; then Dijkstra's stale entries, Bellman-Ford's rounds, a round of Floyd-Warshall and which one to use. Pick an answer to see whether it's right and why. Nothing is saved, so you can take it again.

If one trips you up, its lesson is Introduction to Graphs, Depth-First and Breadth-First Search, Shortest Paths with BFS, Cycles, Bipartite Graphs and Topological Order or Weighted Shortest Paths: Dijkstra, Bellman-Ford and Floyd-Warshall.

Quiz

1 / 16

Multiple choice

A directed graph has the edges [0, 1], [0, 2], [2, 1], [3, 0] and [1, 3]. What are vertex 0's in-degree and out-degree?