Concept of Knapsack
Concept of Knapsack
The knapsack is nothing but a sack where in which we need to place the given items according to the
capacity of the knapsack. In case of backtracking we consider the profits but in dynamic programming
we consider weights.
Algorithm:
Example:
m=15;
n=4;
Tracing: