-
Notifications
You must be signed in to change notification settings - Fork 20k
Implement Maximum Sum of Non-Adjacent Elements #5544
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5544 +/- ##
============================================
+ Coverage 60.15% 60.21% +0.05%
- Complexity 3868 3876 +8
============================================
Files 562 563 +1
Lines 16009 16035 +26
Branches 3069 3073 +4
============================================
+ Hits 9631 9655 +24
- Misses 5973 5974 +1
- Partials 405 406 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix Clang PR check and add some JUnit tests (see https://github.com/TheAlgorithms/Java/tree/master/src/test/java/com/thealgorithms)
Hi @siriak , I've addressed your feedback by fixing the Clang PR check and adding JUnit tests for the |
src/test/java/com/thealgorithms/dynamicprogramming/MaximumSumOfNonAdjacentElementsTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check why build PR check is failing
This PR adds an algorithm to find the maximum sum of non-adjacent elements in an array. The implementation includes two approaches:
Dynamic Programming with O(n) Space Complexity:
Optimized Space Complexity Approach:
clang-format -i --style=file path/to/your/file.java
Related Issues : Issue #5510