IDRASAcademic OS
ADA100% Active LaboratorySIMULATION

0/1 Knapsack Dynamic Programming 2D Table Laboratory

Interactive 2D DP matrix filling for 0/1 Knapsack. Animates decision subproblems between including or excluding each item at given capacity W.

ADA • SIMULATION0/1 Knapsack Dynamic Programming 2D Table Laboratory
ADA • DYNAMIC PROGRAMMINGOptimal Substructure & Memoization

0/1 Knapsack Dynamic Programming 2D Table Laboratory

Max Capacity: 7 kg|Complexity: O(N × W)
Step:1/ 28
Item 1 excluded. Copied previous optimal subproblem dp[0][1] = 0EXCLUDE
Item (Weight, Value)w = 0w = 1w = 2w = 3w = 4w = 5w = 6w = 7
Base Case (0 items)00000000
Item 1 (w:2, v:3)00333333
Item 2 (w:3, v:4)00344777
Item 3 (w:4, v:5)00345789
Item 4 (w:5, v:8)003458811
Want a step-by-step breakdown from our 4 AI Engineering Agents?
Mastery Standard: Complete all 3 tasks in the Lab Protocol to earn verified mastery credits.
Study Full Unit Notes →