Data Structures & AlgorithmsVery hardICPC regional · graph theory
Problem: What is the purpose of the low-link value in Tarjan's strongly connected components algorithm?
- A. It stores the shortest distance from the source
- B. It counts the edges in the component
- C. It sorts vertices topologically
- D. It records the smallest discovery index reachable from a vertex's subtree via back edges
Correct answer: D. It records the smallest discovery index reachable from a vertex's subtree via back edges
A vertex that is its own low-link is the root of an SCC, which lets the stack pop the whole component.
More Coding Interview Problems questions
- Problem: What is the worst-case complexity of the SPFA (queue-based Bellman-Ford) shortest path algorithm?
- Problem: Which property must hold for Huffman coding to produce an optimal prefix code?
- Problem: What is the complexity of Kruskal's algorithm when edges are already sorted and union-find uses path compression and union by rank?
- Problem: What does the Kuhn-Munkres (Hungarian) algorithm compute on a bipartite graph with weights?
- Problem: Which approach computes the number of distinct substrings of a string of length n in O(n log n) with a suffix array?
- Problem: Which graph algorithm checks whether a directed graph is a DAG in O(V + E)?