MCPcopy Create free account
hub / github.com/TheAlgorithms/Rust / counting_sort

Function counting_sort

src/sorting/counting_sort.rs:6–20  ·  view source on GitHub ↗

In place counting sort for collections of u32 O(n + maxval) in time, where maxval is the biggest value an input can possibly take O(maxval) in memory u32 is chosen arbitrarly, a counting sort probably should'nt be used on data that requires bigger types.

(arr: &mut [u32], maxval: usize)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 2

counting_sort_descendingFunction · 0.85
counting_sort_pre_sortedFunction · 0.85

Calls 1

iterMethod · 0.45

Tested by 2

counting_sort_descendingFunction · 0.68
counting_sort_pre_sortedFunction · 0.68