Given items as (value, weight) we need to place them in a knapsack (container) of a capacity k. Note! We can break items to maximize value!
Example input:
values[] = [1, 4, 5, 2, 10]
weights[] = [3, 2, 1, 2, 4]
k = 8
Expected output:
maximumValueOfItemsInK = 20;
Algorithm:
1) Sort values...