Forty Items Two Halves
You have 40 weights and a target sum, and you must decide whether some subset hits the target exactly. Enumerating all subsets is , far too slow.
You split the 40 into two halves of 20, enumerate all subset sums of each half, sort the left list, and for every right-half sum binary search the left list for the complement.
Roughly how many elementary operations does that plan cost?
Sign in to answer questions and track your progress
Sign In