Data structure for handling intervals
问题 I have got a series of time intervals (t_start,t_end), that cannot overlap, i.e.: t_end(i) > t_start(i+1). I want to do the following operations: 1) Add new (Union of) intervals [ {(1,4),(8,10)} U (3,7) = {(1,7),(8,10)} ] 2) Take intervals out [ (1,7) - (3,5) = {(1,3),(5,7)} 3) Checking whether a point or a interval overlaps with an interval in my series (intersection) 4) Finding the first "non-interval" of a minimum length after some point [ {(1,4),(7,8)}: there is a "non-interval" of length