Data Structures & AlgorithmsHardICPC regional · Codeforces Div 2 E

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

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

Correct answer: D. 5

Vertices that can reach each other form one component, giving 5 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