Data Structures & AlgorithmsHardICPC regional · GATE CS top band

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

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

Correct answer: B. 6

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

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic