MCPcopy Index your code
hub / github.com/douchuan/algorithm / LSD_radix_sort

Function LSD_radix_sort

tests/test_strings.rs:12–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11#[test]
12fn LSD_radix_sort() {
13 let i = WORDS3;
14 let mut a = extract_words(i);
15 let w = a[0].len();
16 LSD::sort(&mut a, w);
17 assert!(a.is_sorted());
18
19 // license plate data
20 let mut a = vec![
21 "4PGC938", "2IYE230", "3CIO720", "1ICK750", "1OHV845", "4JZY524", "1ICK750", "3CIO720",
22 "1OHV845", "1OHV845", "2RLA629", "2RLA629", "3ATW723",
23 ];
24 let w = a[0].len();
25 LSD::sort(&mut a, w);
26 assert!(a.is_sorted());
27}
28
29#[test]
30fn LSD_radix_sort_i32() {

Callers

nothing calls this directly

Calls 3

extract_wordsFunction · 0.70
sortFunction · 0.50
lenMethod · 0.45

Tested by

no test coverage detected