Java icon indicating copy to clipboard operation
Java copied to clipboard

Optimize and Format Knapsack Memoization Algorithm

Open Chiefpatwal opened this issue 1 year ago • 5 comments

  • [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

Chiefpatwal avatar Oct 09 '24 17:10 Chiefpatwal

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.

codecov-commenter avatar Oct 09 '24 17:10 codecov-commenter

This pull request fixes the bug in the KnapsackMemoization class by removing unused imports and optimizing the memoization logic.

Chiefpatwal avatar Oct 10 '24 03:10 Chiefpatwal

Could you add JUnit tests that cover the code you have changed?

siriak avatar Oct 10 '24 20:10 siriak

Could you add JUnit tests that cover the code you have changed?

sure

Chiefpatwal avatar Oct 11 '24 09:10 Chiefpatwal

I have added test 4 and test 5 for the same.

Chiefpatwal avatar Oct 11 '24 09:10 Chiefpatwal