1 votes 1 votes $0/1$-Knapsack is a well known problem where, it is desired to get the maximum total profit by placing $n$ items (each item is having some weight and associated profit) into a knapsack of capacity $W$. The table given below shows the weights and associated profits for $5$ items, where one unit of each item is available to you. It is also given that the knapsack capacity $W$ is $8$. If the given $0/1$ knapsack problem is solved using Dynamic Programming, which one of the following will be maximum earned profit by placing the items into the knapsack of capacity $8$. $$\begin{array}{|c|c|c|}\hline \textbf{Item#}&\textbf{Weight}&\textbf{Associated Profit} \\\hline \text{1}&\text{1}&\text{3}\\\hline\text{2}&\text{2}&\text{5}\\\hline\text{3}&\text{4}&\text{9}\\\hline\text{4}&\text{5}&\text{11}\\\hline\text{5}&\text{8}&\text{18} \\\hline\end{array}$$ $19$ $18$ $17$ $20$ Algorithms nielit2017july-scientistb-it algorithms greedy-algorithm knapsack-problem + – admin asked Mar 30, 2020 retagged Aug 23, 2020 by Lakshman Bhaiya admin 2.6k views answer comment Share Follow See 1 comment See all 1 1 comment reply swettt871 commented Jan 19, 2021 reply Follow Share Option A:19 max profit we can earn here. 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes 19 is correct. We can get maximum profit by including item 1,2,4. smsubham answered Mar 30, 2020 smsubham comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes option A) 19 , as it is a 0/1 knapsack we can include item 1,2 and 5 to get maximum profit of 3+5+11=19 Sanandan answered Sep 11, 2020 Sanandan comment Share Follow See all 0 reply Please log in or register to add a comment.