Data Structures & AlgorithmsHardCodeforces Div 2 D

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

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

Correct answer: A. 3

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

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic