librualg 0.29.1

Collection of basic algorithms for everyday development
Documentation
1
2
3
4
5
6
7
8
9
10
11
extern crate librualg;

use librualg::*;

#[test]
fn binary_search() {
    let seq = [1, 2, 3, 3, 4, 5];
    assert_eq!(binary_search::upper_bound(&seq, &3), Some(3));
    assert_eq!(binary_search::lower_bound(&seq, &3), Some(2));
    assert_eq!(binary_search::lower_bound(&seq, &6), None);
}