Algorithms.
not give optimal solution. Dynamic Approach: In this approach, we use a 2D table of size n x W(capacity). It doesn’t work if the capacity is not integer. Brute Force: With n items, there are 2^n solutions to be generated, check each to see if they satisfy the constraint, save maximum solution that