diwas7777 / CodesHub

This open source project is made to help students find codes in different languages easily for every usecase.
https://diwas7777.github.io/CodesHub/
GNU General Public License v2.0
50 stars 136 forks source link

0-1 Knapsack #191

Closed Abhikanksh-Chand closed 2 years ago

Abhikanksh-Chand commented 2 years ago

The program considers all subsets of items and calculates the total weight and value of all subsets. Consider the only subsets whose total weight is smaller than W. From all such subsets, pick the maximum value subset.