Data Structures & AlgorithmsVery hardICPC regional · shortest paths
Problem: Which problem is solved by Dijkstra's algorithm on a graph whose edge weights are small integers, using buckets (Dial's algorithm)?
- A. Shortest paths with bucket queues in O(E + maxW * V)
- B. Minimum spanning tree in O(V)
- C. Topological sort
- D. Matrix chain multiplication
Correct answer: A. Shortest paths with bucket queues in O(E + maxW * V)
Dial's algorithm replaces the heap with an array of buckets indexed by distance.
More Coding Interview Problems questions
- 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?
- 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?