Data Structures & AlgorithmsHardICPC regional · graph theory

Problem: Which algorithm finds the strongly connected components of a directed graph using a single DFS with a stack?

  1. A. Prim's algorithm
  2. B. Kruskal's algorithm
  3. C. Tarjan's algorithm
  4. D. Dijkstra's algorithm

Correct answer: C. Tarjan's algorithm

Tarjan's method uses low-link values and an explicit stack to pop each component in one DFS.

More Coding Interview Problems questions

Exams that ask this topic