Content-Length: 325083 | pFad | http://github.com/TheAlgorithms/Java/pull/6425

E2 Feat(Improved): Add 0/1 Knapsack Problem: Recursive and Tabulation (Bottom-Up DP) Implementations in Java along with their corresponding Tests by o000SAI000o · Pull Request #6425 · TheAlgorithms/Java · GitHub
Skip to content

Feat(Improved): Add 0/1 Knapsack Problem: Recursive and Tabulation (Bottom-Up DP) Implementations in Java along with their corresponding Tests #6425

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 9 commits into from
Jul 22, 2025

Conversation

o000SAI000o
Copy link
Contributor

1.Recursive Solution
-Uses a top-down approach without memoization.
-Highlights the decision process for including or excluding each item.
2.Tabulation (Bottom-Up DP) Solution
-Efficient dynamic programming approach using a 2D table.
-Includes a utility function to print the DP table.
-Demonstrates space-time tradeoff compared to recursion.

Both implementations follow consistent formatting, inline documentation, and are aligned with the repository's existing code structure.

@codecov-commenter
Copy link

codecov-commenter commented Jul 21, 2025

Codecov Report

Attention: Patch coverage is 90.90909% with 3 lines in your changes missing coverage. Please review.

Project coverage is 75.00%. Comparing base (9a46339) to head (72ce8a2).

Files with missing lines Patch % Lines
.../dynamicprogramming/KnapsackZeroOneTabulation.java 90.00% 1 Missing and 1 partial ⚠️
...algorithms/dynamicprogramming/KnapsackZeroOne.java 92.30% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6425      +/-   ##
============================================
+ Coverage     74.97%   75.00%   +0.03%     
- Complexity     5519     5535      +16     
============================================
  Files           684      686       +2     
  Lines         19181    19214      +33     
  Branches       3698     3708      +10     
============================================
+ Hits          14380    14411      +31     
  Misses         4245     4245              
- Partials        556      558       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alxkm alxkm merged commit cfd7841 into TheAlgorithms:master Jul 22, 2025
6 checks passed
@o000SAI000o
Copy link
Contributor Author

Thank you 😊

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








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/TheAlgorithms/Java/pull/6425

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy