$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}$$
64.3k questions
77.9k answers
244k comments
80.0k users