New answers tagged

1 vote
Accepted

Turning stacked overlapping intervals (with associated data) into non-overlapping intervals

I found an answer that works well. The basic concept is to iterate a sorted list of all 'points of interest' (start & end location of intervals). Iterating that (scan line) allows us to maintain a ...
Johannes Weiss's user avatar
0 votes

Turning stacked overlapping intervals (with associated data) into non-overlapping intervals

One conceptually simple approach is to sort the intervals by which is latest. Then create an empty binary tree for the intervals you keep. Iterate through the intervals, from latest on to earliest, ...
D.W.'s user avatar
  • 158k

Top 50 recent answers are included