Skip to content

Conversation

PauLopNun
Copy link
Contributor

  • Implements American Flag Sort using bucket-based radix sort approach
  • Includes comprehensive test suite extending SortingAlgorithmTest
  • Follows project coding standards and documentation style
  • 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
- Implements American Flag Sort using bucket-based radix sort approach - Includes comprehensive test suite extending SortingAlgorithmTest - Follows project coding standards and documentation style
- 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-commenter
Copy link

codecov-commenter commented Oct 6, 2025

Codecov Report

❌ Patch coverage is 97.67442% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 76.65%. Comparing base (69d8406) to head (38712b2).

Files with missing lines Patch % Lines
...java/com/thealgorithms/sorts/AmericanFlagSort.java 97.67% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@ Coverage Diff @@ ## master #6662 +/- ## ============================================ + Coverage 76.60% 76.65% +0.04%  - Complexity 6026 6043 +17  ============================================ Files 719 720 +1 Lines 20326 20369 +43 Branches 3937 3946 +9 ============================================ + Hits 15571 15613 +42  Misses 4164 4164 - Partials 591 592 +1 

☔ 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.
- 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.
Copy link
Member

@DenizAltunkapan DenizAltunkapan left a comment

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Consider adding explicit test cases for small arrays, already sorted arrays, reverse-sorted arrays, duplicates, and empty arrays to ensure correctness. You may want to add tests for null arrays or arrays with a single element to confirm that the algorithm handles these gracefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants