Data Structures & AlgorithmsModerateCodeforces Div 2 D

Directed graph on vertices 0 to 7 with edges: 0→7, 7→4, 3→6, 1→2, 2→1, 7→1, 1→6, 4→5, 4→6, 2→4, 2→0, 2→5, 0→6, 2→6. What is the number of vertices in the largest strongly connected component?

  1. A. 8
  2. B. 7
  3. C. 1
  4. D. 4

Correct answer: D. 4

The largest group in which every vertex reaches every other has 4 vertices. The set reachable from 0 (7 vertices) is not an SCC, and the largest weak component (8) ignores direction.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic