Skip to content

Optimize and Format Knapsack Memoization Algorithm #5685

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Oct 12, 2024

Conversation

Chiefpatwal
Copy link
Contributor

@Chiefpatwal Chiefpatwal commented Oct 9, 2024

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

@codecov-commenter
Copy link

codecov-commenter commented Oct 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Chiefpatwal
Copy link
Contributor Author

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

@siriak
Copy link
Member

siriak commented Oct 10, 2024

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

@Chiefpatwal
Copy link
Contributor Author

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

sure

@Chiefpatwal
Copy link
Contributor Author

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

Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@siriak siriak enabled auto-merge (squash) October 12, 2024 07:11
@siriak siriak merged commit e38611e into TheAlgorithms:master Oct 12, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants