Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/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
3
capacity W to get the maximum total value in the knapsack.
4
Callers
nothing calls this directly
Calls
3
mf_knapsack
Function · 0.85
knapsack_with_example_solution
Function · 0.85
knapsack
Function · 0.70
Tested by
no test coverage detected