小于 1 分钟
Home > @hz-9/algorithm > radixSort
radixSort() function
Radix sort algorithm.
基数排序。
Time complexity: O(n*m)
Time complexity badest case: O(n*m)
Time complexity goodest case: O(n*m)
Space complexity: O(m)
Signature:
radixSort: <T>(list: T[], radixBase?: number, toNumber?: ToNumberFn<T>) => T[]Parameters
Parameter | Type | Description |
|---|---|---|
list | T[] | The array to be sorted. |
radixBase | number | (Optional) The base of the radix. |
toNumber | ToNumberFn<T> | (Optional) |
Returns:
T[]
- The sorted array. (Is original array)