Dynamic Programming21 sections · 916 units
Open in Course

Lessons from Unbounded Knapsack

Simplification

Unbounded knapsack is simpler than 0/1:

1.1. One dimension instead of two (no item index needed)

2.2. Forward iteration instead of backward

3.3. Same item can contribute to dp[w]dp[w] multiple times The pattern generalizes: Coin Change is unbounded knapsack where you minimize count instead of maximizing value. Rod Cutting is unbounded knapsack where length is weight. When you see "unlimited copies" or "can repeat," think unbounded knapsack.