Data Structures & AlgorithmsVery hardICPC regional · interval DP
Problem: Which statement about the Knuth optimization for interval DP is correct when its monotonicity conditions hold?
- A. It reduces O(n^3) interval DP to O(n^2) by bounding the optimal split point between neighbouring intervals
- B. It needs O(n!) time
- C. It only applies to graphs with negative cycles
- D. It replaces DP with greedy selection
Correct answer: A. It reduces O(n^3) interval DP to O(n^2) by bounding the optimal split point between neighbouring intervals
Monotone optimal split points let each interval search only a narrow range, which totals O(n^2).
More Coding Interview Problems questions
- Problem: What is the time complexity of building a suffix array with prefix doubling and radix sort?
- Problem: Which problem is solved by the Aho-Corasick automaton?
- Problem: Which claim about the centroid decomposition of a tree is correct?
- Problem: What is the complexity of answering distance queries on a tree after O(n log n) preprocessing with the sparse-table LCA?
- Problem: In a Fenwick tree over n positions, what is the cost of a range-sum query combined with point updates?
- Problem: Which property must a function have for ternary search to find its maximum correctly?