Data Structures & AlgorithmsHardCodeforces Div 2 D

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

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

Correct answer: A. 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 (9) ignores direction.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic