Imagine that I have a set of minimum values ββand maximum values. I want the data structure, which, given the external value, to most effectively give me pairs (min, max) for which the value> = min, the value <= max.
If you know that the ranges do not overlap, I suppose you could just create a balanced binary search tree in min, and the first node that has (min, max) that is satisfied should be the only one, But if the ranges can overlap, is there a data structure that can allow you to do this efficiently?
source
share