TheAlgorithms / C-Plus-Plus

Collection of various algorithms in mathematics, machine learning, computer science and physics implemented in C++ for educational purposes.
https://thealgorithms.github.io/C-Plus-Plus
MIT License
30.03k stars 7.1k forks source link

Add/0 1 knapsack in reduced space #2628

Closed dishhaa03 closed 9 months ago

dishhaa03 commented 10 months ago

Description of Change

Added a new file named "0_1_knapsack_new.cpp" in the dynamic programming folder which solves the problem in reduced space complexity that is O(n).

Fixes #2604 [FEATURE] Reduce space complexity of 0-1 Knapsack problem #2604

Checklist

Notes:

github-actions[bot] commented 9 months ago

This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 9 months ago

Please ping one of the maintainers once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!