Why it matters
Rod cutting is unbounded knapsack variant. Understanding shapes DP patterns.
Advertisement
The architecture
dp[j] = max revenue for length j.
Try each first cut i in [1, j].
Advertisement
How it works end to end
dp[j] = max over i of (price[i] + dp[j-i]).
Reconstruct cuts via choices.
Similar to unbounded knapsack.