Skip to content
RED SAG Skills
mediumStudy question · answer published in Data Structures and Algorithms interview questions, so no pointsdynamic-programmingknapsackspace-optimization

Direction of the capacity loop

In the 1D 0/1 knapsack, dp[w] = max(dp[w], dp[w - wt] + val). Why must w go from W down to wt?

Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions