A connected, undirected road network has 1,200 intersections (vertices) and 4,500 road segments (edges), with no self-loops or repeated edges. You run one breadth-first search from a single start intersection, marking each vertex as visited when it is added to the queue.
Give each answer as an exact whole number:
Unlock full course notes by signing up
Marking vertices when queued or when removed
A network crawler keeps a frontier, the queue of records awaiting processing. It runs on a connected, undirected graph with VVV vertices and EEE edges, with no self-loops or parallel edges. Each edge counts as one hop, and the graph is stored using adjacency lists.
Compare two breadth-first search variants. Both use a first-in, first-out queue. Early marks each vertex seen when it is enqueued, records its distance then, and enqueues only unseen neighbours. Late instead runs the following code:
Assume the adjacency lists already exist and each set or queue operation shown takes constant time. Which statements are true? Select every true statement.
Discovery and finish times on a directed graph
The directed graph below has six vertices. Its adjacency lists, each already in alphabetical order, are:
A: B, D
B: C, E