Data Structures & AlgorithmsModerateICPC regional · Codeforces Div 2 E

Directed graph on vertices 0 to 8 with edges: 7→0, 1→7, 7→1, 7→4, 8→2, 7→3, 7→5, 6→4, 3→1, 8→7. How many strongly connected components does it have (maximal sets in which every vertex can reach every other)?

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

Correct answer: C. 7

Vertices that can reach each other form one component, giving 7 groups in total. Ignoring edge directions gives only 1 weakly connected pieces, which is the usual slip.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic