Step 1/0
Custom array:
Complexity
Best:O(n·W)
Average:O(n·W)
Worst:O(n·W)
Space:O(n·W)
Description
Finds the maximum value subset of items that fits in a weight-capacity knapsack, where each item can be taken or left.
When to use
Resource allocation, budget optimization, cargo loading. Classic DP problem with many real-world variants.