Algorithms and Data Structures · Senior · Question 24 of 75

What does it mean that the 0/1 knapsack DP is pseudo-polynomial?

Explanation

The table has W columns, and each extra bit in W doubles it, so the work is exponential in the input size. Knapsack is NP-hard; the DP is fast only when capacities are small integers.

Further reading

Problem with a question

Algorithms and Data Structures · Senior · question 24

Test yourself

Take the Algorithms and Data Structures · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz