pofk_algorithm 0.0.3

A collection of efficient algorithms implemented in Rust for real-world projects.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#[cfg(test)]
mod tests {
    use crate::set_algorithms::has_duplicates::has_duplicates;
    #[test]
    fn test_has_duplicates() {
        let arr = [1, 2, 3, 2];
        assert!(has_duplicates(&arr));
        let arr = [1, 2, 3];
        assert!(!has_duplicates(&arr));
        let arr: [i32; 0] = [];
        assert!(!has_duplicates(&arr));
        let arr = [1];
        assert!(!has_duplicates(&arr));
    }
}