Skip to content

Conversation

PauLopNun
Copy link
Contributor

  • 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 Postman Sort using gap-based insertion approach
- Adaptive gap reduction with shrink factor of 1.3
- Includes comprehensive test suite extending SortingAlgorithmTest
@codecov-commenter
Copy link

codecov-commenter commented Oct 6, 2025

Codecov Report

❌ Patch coverage is 81.81818% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.61%. Comparing base (69d8406) to head (6f16064).

Files with missing lines Patch % Lines
...main/java/com/thealgorithms/sorts/PostmanSort.java 81.81% 1 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #6665   +/-   ##
=========================================
  Coverage     76.60%   76.61%           
- Complexity     6026     6034    +8     
=========================================
  Files           719      720    +1     
  Lines         20326    20348   +22     
  Branches       3937     3942    +5     
=========================================
+ Hits          15571    15589   +18     
- Misses         4164     4165    +1     
- Partials        591      594    +3     

☔ 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.

@DenizAltunkapan
Copy link
Member

@PauLopNun
The current implementation is named PostmanSort, but the code actually implements a Shellsort-like algorithm with a gap factor of 1.3. While it correctly sorts the array, it does not implement the classical Postman Sort as described in the reference link, which is typically a digit- or bucket-based sorting algorithm (similar to counting sort or radix sort for postal codes).

As a result, the name PostmanSort is misleading. To address this, you could either:

  1. Rename the class to ShellSort (or another appropriate name), since a Shellsort implementation already exists here.
  2. Implement a true Postman Sort, following a digit/bucket-based approach.

Nevertheless, this PR cannot be merged, because the implementation does not match the algorithm name or description.

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