🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: 0/1 Knapsack and Subset Sum: all 10 questions

Quiz: 0/1 Knapsack and Subset Sum · Question 7 of 10

How does equal partition reduce to subset sum?

How does equal partition reduce to subset sum?

  1. A.Check whether the largest number equals the smallest
  2. B.Sort the numbers and split them in the middle
  3. C.Check whether the total is a multiple of 3
  4. D.If the total is even, ask whether some subset sums to total / 2
Answer & explanation

Correct answer: If the total is even, ask whether some subset sums to total / 2

If one group sums to half the total, the remaining numbers form the other half.

Can you get the rest right without peeking?

Take the timed Quiz: 0/1 Knapsack and Subset Sum quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →