Skip to content

Latest commit

 

History

History

UnboundedKnapsack

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Unbounded Knapsack

Problem:

Given weights: list of weights where weights[i] represents the weight of i-th item, values : list of values where values[i] represents the value of i-th item, and capacity, total capacity available, Find the maximum values that can be achieved within the limit of total weight.

same items can be used multiple times

Example:

weights = [1,2,3,5]
values =  [1,4,7,10]
capacity = 8
Output: 18