I am wondering if anyone knows of a data structure which would efficiently handle the following situation:
The data structure should store several, possibly overlapping, variable length ranges on some continuous timescale.
For example, you might add the ranges
a:[0,3], b:[4,7], c:[0,9]
.Insertion time does not need to be particularly efficient.
Retrievals would take a range as a parameter, and return all the ranges in the set that overlap with the range, for example:
Get(1,2)
would return a and c.Get(6,7)
would return b and c.Get(2,6)
would return all three.Retrievals need to be as efficient as possible.