Data Structures & AlgorithmsVery hardCodeforces Div 2 D

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

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

Correct answer: B. 7

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