Data Structures & AlgorithmsHardHCLTech · Wipro pattern

An undirected connected graph has edges A–B, B–C, C–D, D–E, E–F, F–G, G–H, D–F, F–H. How many articulation points (cut vertices) and how many bridges does it have?

  1. A. 4 articulation point(s), 2 bridge(s)
  2. B. 3 articulation point(s), 3 bridge(s)
  3. C. 4 articulation point(s), 3 bridge(s)
  4. D. 3 articulation point(s), 4 bridge(s)

Correct answer: C. 4 articulation point(s), 3 bridge(s)

Removing each vertex (or edge) in turn and checking whether the graph stays connected identifies 4 cut vertices and 3 bridges here. A bridge's endpoints are cut vertices unless one of them is a leaf, and a vertex can be a cut vertex even where no single edge is a bridge (e.g. it joins two otherwise-separate cycles).

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic