| ↓item / w→ | 0 | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|---|
| ∅ (none) | 0 | 0 | 0 | 0 | 0 | 0 |
| Aw=2 | 0 | 0 | 0 | 0 | 0 | 0 |
| Bw=2 | 0 | 0 | 0 | 0 | 0 | 0 |
| Cw=3 | 0 | 0 | 0 | 0 | 0 | 0 |
Tabulation (Bottom-Up DP) solves all sub-problems iteratively from smallest to largest, filling a 2D table. No recursion needed — just a nested loop that builds the answer from scratch.
Given N items with weights and values, and a knapsack of capacity W, pick items to maximize total value without exceeding W. Each item can only be picked once (0/1).