I have a set of time intervals In = (an, bn). I need to run lots of look ups where I\'m given a time t and need to quickly return the intervals that conta
What you are looking for is an Interval Tree (which is a type of Range Tree).
These have logarithmic lookup time like other tree structures (e.g., RB trees), so you should see comparable performance to using something like a Java TreeMap or an STL map.