Data Structures & AlgorithmsVery hardICPC regional · meet in the middle
Problem: Which problem is solved by the 'meet in the middle' technique on a subset-sum instance with n = 40?
- A. Dynamic programming over all 2^40 subsets
- B. Greedy selection by size
- C. Binary search on the answer
- D. Splitting into two halves of 2^20 subsets each
Correct answer: D. Splitting into two halves of 2^20 subsets each
Each half has 2^20 subset sums which are then merged with sorting or hashing.
More Coding Interview Problems questions
- Problem: What does the 'two-phase' Kosaraju algorithm compute?
- Problem: Which best describes the complexity of Dijkstra on a graph with V = 10^5 and E = 10^6 using an array instead of a heap?
- Problem: What is the Stern-Brocot tree's relevance to competitive programming?
- Problem: Which algorithm finds all integer points on the convex hull boundary of a set of points?
- Problem: What is the purpose of the 'sqrt decomposition' technique for an array?
- Problem: Which statement about the 'Chinese remainder theorem' is correct for non-coprime moduli?