Suppose I have a number of objects with a start value and an end value that are comparable via some Comparator.
What kind of collection can I use to make an index of the objects, so that given an arbitrary value V, I can find all the objects where V is between the start and end values?
I’m stumped.
See http://en.wikipedia.org/wiki/Interval_tree. You should probably ignore the complicated “centered tree” construction that occurs first there, and look instead at the “augmented tree” which is the standard way to do it.