> Since you say "intervals" in plural here, I assume that they can overlap?

Yes,

For instance, there are the following intervals :
[[1, 10],
[4, 7],
[6, 15],
[11, 17]]

asking for the intervals including  5, the returned value should be

[[1, 10],
[4, 7]]

The idea here to make it fast is to have done some preprocessing at
insertion time, so that not all intervals are processed at query time.



On Sat, May 12, 2012 at 2:30 PM, Karl Knechtel <zahl...@gmail.com> wrote:
> On Sat, May 12, 2012 at 8:17 AM, Jean-Daniel
> <jeandaniel.bro...@gmail.com> wrote:
>> I am looking for a fast way to find the intervals
>> containing a given date, without having to check all intervals (less
>> than O(n)).
>
> Since you say "intervals" in plural here, I assume that they can overlap?
>
> --
> ~Zahlman {:>
> --
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to