Note: this crate is a fork of the original merged_range crate, which is not maintained anymore. More details in the issue #1.
merged_range2
A crate that can merge overlapping ranges.
Overview
merged_range2
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, it can merge the new range with the existing ranges.
Insert and query time complexity is both O(logn).
Example
Add the dependency to Cargo.toml
[]
= "1.0.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 Apache license.