Data Structures & AlgorithmsHardGATE CS · Codeforces Div 2

Directed graph on vertices A, B, C, D, E, F with edges D→F, F→B, E→F, D→E, D→B, E→D. How many strongly connected components does it have? Count each vertex's component, including single vertices that have no cycle through them.

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

Correct answer: A. 5

Mutual-reachability classes give 5 strongly connected components; weakly connected components ignore direction and give 3.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic