-
Notifications
You must be signed in to change notification settings - Fork 20.9k
Add MaxAlternatingSum algorithm implementation #7085
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
Refactored maxAlternatingSum method to use squared values and improved variable naming.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@ ## master #7085 +/- ## ============================================ - Coverage 78.50% 78.44% -0.06% + Complexity 6752 6750 -2 ============================================ Files 759 760 +1 Lines 22402 22416 +14 Branches 4400 4403 +3 ============================================ - Hits 17587 17585 -2 - Misses 4109 4123 +14 - Partials 706 708 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Jashnavi25
commented
Nov 20, 2025
Hi maintainers 👋
This PR adds a new algorithm MaxAlternatingSum to the devutils package,
with documentation and proper formatting.
All checks passed successfully ✔️
Kindly review when you get time.
Thank you! 🙏
This PR adds a Java implementation of Max Alternating Sum to the devutils package.
Includes:
✔ Javadoc documentation
✔ Clean formatting and package declaration
✔ Sorting + arithmetic based optimal algorithm
✔ Follows TheAlgorithms conventions
Time Complexity: O(n log n)
Space Complexity: O(n)