Data Structures & AlgorithmsHardGATE CS · Codeforces Div 2

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

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

Correct answer: B. 4

Mutual-reachability classes give 4 strongly connected components; weakly connected components ignore direction and give 1.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic