Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/subbarayudu-j/TheAlgorithms-Python
/ knapsack.py
File
knapsack.py
dynamic_programming/knapsack.py:None–None ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
1
""
"
2
Given weights and values of n items, put these items in a knapsack of capacity W to get the maximum total value in the knapsack.
3
""
"
4
def
MF_knapsack(i,wt,val,j):
Callers
nothing calls this directly
Calls
2
knapsack
Function · 0.85
MF_knapsack
Function · 0.85
Tested by
no test coverage detected