Optimize and Format Knapsack Memoization Algorithm
- [x] I have read CONTRIBUTING.md.
- [x] This pull request is all my own work -- I have not plagiarized it.
- [x] All filenames are in PascalCase.
- [x] All functions and variable names follow Java naming conventions.
- [x] All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
- [x] All new code is formatted with
clang-format -i --style=file path/to/your/file.java
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 63.52%. Comparing base (
b81671e) to head (eaf0ea1).
Additional details and impacted files
@@ Coverage Diff @@
## master #5685 +/- ##
=========================================
Coverage 63.51% 63.52%
+ Complexity 4097 4096 -1
=========================================
Files 575 575
Lines 16085 16083 -2
Branches 3090 3089 -1
=========================================
Hits 10216 10216
+ Misses 5451 5450 -1
+ Partials 418 417 -1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This pull request fixes the bug in the KnapsackMemoization class by removing unused imports and optimizing the memoization logic.
Could you add JUnit tests that cover the code you have changed?
Could you add JUnit tests that cover the code you have changed?
sure
I have added test 4 and test 5 for the same.