Data Structures & AlgorithmsHardCodeforces Div 2 D

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

  1. A. 8
  2. B. 1
  3. C. 6
  4. D. 0

Correct answer: C. 6

The largest group in which every vertex reaches every other has 6 vertices. The set reachable from 0 (1 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