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

Function sorted_data

tests/test_strings.rs:84–108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82// also fine for sorted data
83#[test]
84fn sorted_data() {
85 let mut a = vec![
86 "4PGC938", "2IYE230", "3CIO720", "1ICK750", "1OHV845", "4JZY524", "1ICK750", "3CIO720",
87 "1OHV845", "1OHV845", "2RLA629", "2RLA629", "3ATW723",
88 ];
89 a.sort();
90
91 // lsd
92 let w = a[0].len();
93 LSD::sort(&mut a, w);
94 assert!(a.is_sorted());
95
96 // msd
97 MSD::sort(&mut a);
98 assert!(a.is_sorted());
99
100 // three-way quick
101 Quick3String::sort(&mut a);
102 assert!(a.is_sorted());
103
104 // lsd32
105 let mut a: Vec<i32> = (0..10).collect();
106 LSD::sort_i32(&mut a);
107 assert!(a.is_sorted());
108}
109
110#[test]
111fn trie_st() {

Callers

nothing calls this directly

Calls 3

sortFunction · 0.50
sortMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected