Given some items, pack the knapsack to get the maximum total value. Each item has some weight and some value. Total weight that we can carry is no more than some fixed number W. So, we must consider weights of items as well as their values. Items are indivisible; you either take an item or not. Considering Weights = {3,4,6,5} Profits = (2,3,1,4} W= 8, n=4 Solved the problem with dynamic programming. Draw the look-up table, based on the Dynamic Programming method, for the 0-1 knapsack problem. Provide the final optimal solution, too
Answers
Answered by
0
Answer:
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. In other words, given two integer arrays val[0..n-1] and wt[0..n-1] which represent values and weights associated with n items respectively. Also given an integer W which represents knapsack capacity, find out the maximum value subset of val[] such that sum of the weights of this subset is smaller than or equal to W. You cannot break an item, either pick the complete item or don’t pick it (0-1 property).
Explanation:
pls mark as brainliest and i hope this helps :)
Answered by
0
Answer:
hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
Similar questions
Math,
3 months ago
Math,
3 months ago
Math,
7 months ago
Computer Science,
10 months ago
Biology,
10 months ago