Data Structures & AlgorithmsHardICPC regional · data structures
Problem: What is the Ackermann-related complexity that appears in union-find analysis?
- A. The logarithm of n
- B. The square root of n
- C. The factorial of n
- D. The inverse Ackermann function alpha(n)
Correct answer: D. The inverse Ackermann function alpha(n)
Union-find with path compression and union by rank costs O(alpha(n)) amortised per operation.
More Coding Interview Problems questions
- 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?
- Problem: Which algorithm computes a minimum-weight perfect matching in general (non-bipartite) graphs?
- Problem: Which property must a function satisfy for the Knuth optimisation of DP to apply?
- Problem: What is the maximum number of edges in a simple planar bipartite graph with V >= 3 vertices?
- Problem: An undirected graph has vertices 0–5 and edges 0-1, 1-2, 2-0, 2-3, 3-4, 4-5, 5-3. How many edges are bridges (removal increases…
- Problem: Vertices 1–5 of a directed graph have arcs 1→2, 2→3, 3→1, 3→4, 4→5, 5→4, and 1→5. Using DFS from vertex 1, how many back edges…