Knapsack
Knapsack
Algorithm
ALGORITHM
KNAPSACK
2023
P R O B L E M S TAT E M E N T
BOUNDED UNBOUNDED
0/1 KNAPSACK
Recusrion
Invloves the Brute Force
Method for solving
Wa y s t o
Solve
Dynamic Programming
Most effiecnt method for solving this
problem
R E C U R S I V E E Q U AT I O N S
0/1 Knapsack (n , m)
01KS (0,0) 01KS (0,1) 01KS (0,1) 01KS (0,2) 01KS (0,1) 01KS (0,2) 01KS (0,2) 01KS (0,3)
CODE:
DYNAMIC PROGRAMMING:
• Overlapping subproblems
Recursion O(2^n)
• Resource allocation
• Project Planning
• Determine optimal project set in funding
• Selecting optimal loadouts
Any Questions?