Time complexity of 0/1 Knapsack via DP with n items and capacity W?
Time complexity of 0/1 Knapsack via DP with n items and capacity W?
Choose an Option
Answer
O(nW)
Theory
DP table of size n × W is filled, each cell in O(1).
Solution
Pseudo-polynomial complexity O(nW).