Data Structures & AlgorithmsHardCodeforces Div 2 D

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

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

Correct answer: C. 3

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

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic