C-Plus-Plus
C-Plus-Plus copied to clipboard
Create Unbounded_knapsack.cpp
Description of Change
Issue - #2782
Added Unbounded Knapsack Algorithm in Dp section with algorithm, task and test cases. Also code is verified using gfg ide.
For reference :
Checklist
- [x] Added description of change
- [x] Added file name matches File name guidelines
- [x] Added tests and example, test must pass
- [x] Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
- [x] Relevant documentation/comments is changed or added
- [x] PR title follows semantic commit guidelines
- [x] Search previous suggestions before making a new one, as yours may be a duplicate.
- [x] I acknowledge that all my contributions will be made under the project's license.
Notes: Please review and suggest changes if any @realstealthninja
Sure @realstealthninja I would update the PR soon. Thank you.
I have updated the documentation and code accordingly. Please review @realstealthninja . Thank you.
@realstealthninja I have updated accordingly. Please review.
@realstealthninja I have updated the file accordingly. Please review.
@realstealthninja done all changes accordingly.
@realstealthninja all changes are done accordingly. Hope so code is ready for merge
@realstealthninja done. Hope that file is ready for the merge now.
@realstealthninja No, in the standard unbounded knapsack problem, the maximum value cannot be negative. The problem is designed to maximize the total value of items placed in the knapsack, and item values are typically non-negative. If all items have zero or negative values, the optimal solution would be to select no items, resulting in a maximum value of 0. Thus, the maximum value is always non-negative.
@realstealthninja No, in the standard unbounded knapsack problem, the maximum value cannot be negative. The problem is designed to maximize the total value of items placed in the knapsack, and item values are typically non-negative. If all items have zero or negative values, the optimal solution would be to select no items, resulting in a maximum value of 0. Thus, the maximum value is always non-negative.
oh i see! thanks for the clarification
Allow me to work on this , I am kinda late to hacktober so want to complete my PRs