🎙 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 9 of 10

Why is knapsack called pseudo-polynomial?

Why is knapsack called pseudo-polynomial?

  1. A.It sometimes gives wrong answers
  2. B.Its time O(n · W) grows with the value of W, not with the number of digits needed to write W
  3. C.It uses recursion
  4. D.It works only for small n
Answer & explanation

Correct answer: Its time O(n · W) grows with the value of W, not with the number of digits needed to write W

With W = 10⁹ the table is far too large, even though W is written with only 10 digits.

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 →