-
Notifications
You must be signed in to change notification settings - Fork 20.4k
Add AmericanFlagSort algorithm #6662
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
Open
PauLopNun
wants to merge
6
commits into
TheAlgorithms:master
from
PauLopNun:feat/add-american-flag-sort
Open
Add AmericanFlagSort algorithm #6662
PauLopNun
wants to merge
6
commits into
TheAlgorithms:master
from
PauLopNun:feat/add-american-flag-sort
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Implements American Flag Sort using bucket-based radix sort approach - Includes comprehensive test suite extending SortingAlgorithmTest - Follows project coding standards and documentation style
@PauLopNun
PauLopNun
requested review from
DenizAltunkapan,
yanglbme and
alxkm
as code owners
October 6, 2025 00:24
- Replace radix-based approach with generic bucket partitioning - Handle all data types: integers, floats, strings, custom objects - Support edge cases: NaN, Infinity, empty strings, mixed values - Use insertion sort for small arrays for better performance - Maintains O(n log n) average case complexity
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@ ## master #6662 +/- ## ============================================ + Coverage 75.75% 75.80% +0.05% - Complexity 5772 5790 +18 ============================================ Files 703 704 +1 Lines 19777 19820 +43 Branches 3832 3841 +9 ============================================ + Hits 14982 15025 +43 Misses 4215 4215 Partials 580 580 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Remove trailing spaces from lines 16, 30, 55, 59, 70, 80 - Improve code formatting for checkstyle compliance - Maintain same functionality and logic
- Change double spaces to single spaces before inline comments - Lines 56-58: Adjust comment spacing to match clang-format requirements - Maintain code readability and functionality
The CodeQL workflow failed due to a flaky BloomFilterTest, not related to AmericanFlagSort code. This empty commit triggers a re-run.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
clang-format -i --style=file path/to/your/file.java