pub fn find_interval<T: PartialOrd + PartialEq>(sorted_intervals: &Vec<(T, T)>, x: T) -> usize {
    let mut i = 0;
    let mut j = sorted_intervals.len() - 1;

    // Check range
    assert!(
        x >= sorted_intervals[0].0,
        "x is smaller than the smallest interval"
    );
    assert!(
        x <= sorted_intervals[sorted_intervals.len() - 1].1,
        "x is larger than the largest interval"
    );

    while i <= j {
        let mid = (i + j) / 2;
        if x < sorted_intervals[mid].0 {
            j = mid - 1;
        } else if x > sorted_intervals[mid].1 {
            i = mid + 1;
        } else {
            return mid;
        }
    }
    i
}
Find the index of interval of x

# Examples
```
extern crate peroxide;
use peroxide::fuga::*;

let x = vec![
(0, 5),
(5, 7),
(7, 10),
(10, 15),
(15, 20),
(20, 30)
];

assert_eq!(find_interval(&x, 11), 3);
```
src/util/useful.rs