Resource · Guide or article
Radix Sort
Radix sort, a non-comparison sort that groups keys digit by digit, with a careful look at when it beats O(n log n) sorts.
Reviewed
Open the original: Radix Sort (opens the original site in a new tab)Add to a roadmap
Keep this resource with a roadmap you follow. It appears as your own extra resource; the roadmap's steps don't change and it doesn't count toward your tracked steps.
Source content: English
Read this in other languages: Português, In computer science, radix sort is a non-comparative integer sorting algorithm that sorts data with integer keys by grouping keys by the individual digits which share the same significant position and value. A positional notation is required, but because integers can represent strings of characters (e.g., names or dates) and specially formatted floating point numbers, radix sort is not limited to integers. In mathematical numeral systems, the radix or base is the number of unique digits, including the digit zero, used to represent numbers in a positional numeral system. For example, a binary system (using numbers 0 and 1) has a radix of 2 and a decimal system (using numbers 0 to 9) has a radix of 10.
PrepKit overview
PrepKit editors wrote and reviewed this overview from the source repository. It is not text from the resource itself.
- Suited to
- The source does not state a level
- Format
- Reference
What it covers
- Origin of the name: radix as the base of a numeral system.
- Efficiency section: O(wn) cost and why w cannot always be treated as a constant.
- Complexity table: n * k time, n + k memory, stable, with k the longest key length.
How to use it
PrepKit study advice, not a claim made by the source.
Code least-significant-digit radix sort for non-negative integers and explain what w and k mean for your input.
Scope and limitations
No step-by-step walkthrough beyond one image, no handling of negatives, and no exercises. A Portuguese version is linked.
Access and format
English README on GitHub; free; MIT-licensed trekhleb/javascript-algorithms.
Reviewed by PrepKit on Oct 2, 2026. Listing source commit: 85293e3e2b88
Evidence behind this overview
- src/algorithms/sorting/radix-sort/README.md
Pages that include this
Get the PrepKit newsletter
Optional. You don't need it to use PrepKit.