It is a classic dynamic programming problem in which we have to collect items in the knapsack in such a way that our profit is maximized. The difference between this problem and the fractional knapsack one is that you CANNOT take a fraction of an item.
The algorithm to solve the problem has been implemented in three ways:
- recursive
- top-down
- bottom-up (Dynamic Programming)
The time complexity of the dynamic programming solution is: O(N^2)
📦Binary-Knapsack-Problem-DP ┣ 📜main.cpp ┗ 📜README.md