Data structure for quick time interval look up -


I have a set of time interval in = (a, bn) I have a lot of lookups Need to run where I T is given at one time and the need to quickly return those gaps in which t , such as those intervals like A & lt; = T & lt; = Bn .

What is a good data structure or algorithm for this?

If it matters, in my case a and BN are integers.

There is one for what you are looking for (which is of one type).

These are logarithmic lookup times such as other tree structures (e.g., RB trees), so you should see comparable performance to use something like JavaTrinmark or a STL map.

  • From MIT
  • There is one.
  • One here

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -