Data Structures & AlgorithmsVery hardAmazon OA · Graphs

A directed graph has edges 1->2, 2->3, 2->5, 3->1, 3->4, 4->8, 5->6, 6->5, 6->7, 7->8, 8->4, 9->7, 9->8. How many strongly connected components does it have?

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

Correct answer: A. 5

The components are {1,2,3}, {5,6}, {4,8}, {7} and {9}.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic