merged_range
A crate that can merge overlapping ranges
Overview
merged_range is used to query whether the given range is contained in the existing range, if it is contained, return true, otherwise return false. it uses a sorted vector to store ranges. and it can merge the new range with the existing ranges. insert and query time complexity is both O(logn).
Example
add dependency to Cargo.toml
[]
= "0.1.0"
then use it in your code
use MergedRange;
let mut mr = new;
mr.insert_range;
mr.insert_range;
assert_eq!;
assert_eq!;
License
This project is licensed under the MIT license.