radixSort
radixSort<
T>(items,valueOf):T[]
Defined in: sort/radix-sort.ts:17
Sorts items ascending by a non-negative integer key, stable — LSD radix
sort, O(n · k) for k the number of 8-bit digits the largest key needs. Never
calls a comparator, so it beats comparison sorts by a wide margin on large
collections of integer-keyed items (raw numbers, coordinates, counts).
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”readonly T[]
The items to sort. Not modified; a new array is returned.
valueOf
Section titled “valueOf”Callable<[T], number>
Extracts the non-negative integer sort key from an item.
Returns
Section titled “Returns”T[]
A new array of items sorted ascending by valueOf.
Throws
Section titled “Throws”If any key is negative or not a safe integer.