-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
Copy pathlib.rs
39 lines (35 loc) · 795 Bytes
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
pub mod backtracking;
pub mod big_integer;
pub mod bit_manipulation;
pub mod ciphers;
pub mod compression;
pub mod conversions;
pub mod data_structures;
pub mod dynamic_programming;
pub mod financial;
pub mod general;
pub mod geometry;
pub mod graph;
pub mod greedy;
pub mod machine_learning;
pub mod math;
pub mod navigation;
pub mod number_theory;
pub mod searching;
pub mod sorting;
pub mod string;
#[cfg(test)]
mod tests {
use super::sorting;
#[test]
fn quick_sort() {
//descending
let mut ve1 = vec![6, 5, 4, 3, 2, 1];
sorting::quick_sort(&mut ve1);
assert!(sorting::is_sorted(&ve1));
//pre-sorted
let mut ve2 = vec![1, 2, 3, 4, 5, 6];
sorting::quick_sort(&mut ve2);
assert!(sorting::is_sorted(&ve2));
}
}