0/1 Knapsack

Given items with weight and value, maximize total value within a limited capacity.

Time: O(n * W) | Space: O(n * W)

Controls

Phone
w=1v=6
Book
w=2v=10
Laptop
w=3v=12
Camera
w=2v=8
FastSlow
🎒

Press Start to visualize the 0/1 Knapsack algorithm

Items will be packed optimally into a knapsack of capacity 7