0/1 Knapsack: Take or Leave
Maximize value under a weight cap.
The Knapsack Story
You have a bag with a weight limit and a pile of items. The 0/1 knapsack asks: which items maximize value without overpacking? 🎒
Take or Leave
The word 0/1 means each item is either fully taken or fully skipped. You can never grab half an item, so every choice is yes or no.
All lessons in this course
- 0/1 Knapsack: Take or Leave
- Space-Optimized Knapsack
- Unbounded & Coin-Change DP
- Subset Sum & Partition