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?

  1. A. Dynamic programming over all 2^40 subsets
  2. B. Greedy selection by size
  3. C. Binary search on the answer
  4. 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

Exams that ask this topic