MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / unsignedRadixSort

Function unsignedRadixSort

sort/radixsort.go:35–44  ·  view source on GitHub ↗
(arr []T)

Source from the content-addressed store, hash-verified

33}
34
35func unsignedRadixSort[T constraints.Integer](arr []T) []T {
36 if len(arr) == 0 {
37 return arr
38 }
39 maxElement := max.Int(arr...)
40 for exp := T(1); maxElement/exp > 0; exp *= 10 {
41 arr = countSort(arr, exp)
42 }
43 return arr
44}
45
46func RadixSort[T constraints.Integer](arr []T) []T {
47 if len(arr) < 1 {

Callers 1

RadixSortFunction · 0.85

Calls 2

IntFunction · 0.92
countSortFunction · 0.85

Tested by

no test coverage detected