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?
- A. Prim's algorithm
- B. Kruskal's algorithm
- C. Tarjan's algorithm
- 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
- Problem: What is the maximum number of edges in a bipartite graph on n vertices with sides of size n/2?
- Problem: Which problem is solved by Dijkstra's algorithm on a graph whose edge weights are small integers, using buckets (Dial's algorithm)?
- Problem: What is the best known approach for range-mode queries on a static array?
- Problem: Which concept describes the minimum number of comparisons to find the maximum of n numbers?
- Problem: What is the Ackermann-related complexity that appears in union-find analysis?
- Problem: What is the expected number of steps for a random walk on a path of length n starting at one end to reach the other end?