[go: up one dir, main page]

Module: sorting/radixsort

Least significant digit (LSD) Radix sort. A non-comparative, stable integer sorting algorithm.

Worst-case time complexity is O(N K) for N keys with K being the average key length, measured in number of digits.
Parameters:
Name Type Description
array Array Input integer array
Source:
Returns:
Sorted array
Type
Array
Example
var sort = require('path-to-algorithms/src/' +
'sorting/radixsort').radixSort;
console.log(sort([2, 5, 1, 3, 4])); // [ 1, 2, 3, 4, 5 ]