Skip to content

Conversation

saviour2
Copy link

@saviour2 saviour2 commented Oct 2, 2025

This pull request introduces a TypeScript implementation of the Radix Sort algorithm.

Radix Sort is a fundamental, non-comparison based integer sorting algorithm that was missing from the existing collection. Its inclusion provides a more comprehensive set of sorting algorithms in the repository, showcasing a different sorting paradigm from comparison-based sorts like Quick Sort or Merge Sort.

This implementation uses the LSD (Least Significant Digit) method and is designed as a pure function—it does not mutate the original input array but instead returns a new, sorted array. The code is fully typed and includes JSDoc comments for clarity.

Related Issue
N/A

Type of Change
Please delete options that are not relevant.

[x] New feature (non-breaking change which adds functionality)

How Has This Been Tested?
The algorithm has been tested locally with a variety of integer arrays, including empty arrays, arrays with negative numbers (if applicable), and arrays with duplicate values. A corresponding test file (radix_sort.test.ts) has been added to the test suite to ensure its correctness and prevent future regressions.

(Note: Be sure to actually create and include this test file in your PR.)

Checklist:
[x] My code follows the style guidelines of this project.

[x] I have performed a self-review of my own code.

[x] I have commented my code, particularly in hard-to-understand areas, using JSDoc.

[x] My changes generate no new warnings or linting errors.

[x] I have added tests that prove my feature works.

[x] New and existing unit tests pass locally with my changes.

Implement Radix Sort algorithm with Counting Sort as a helper function.
feat(sorts): Add Radix Sort algorithm
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.

1 participant