pub fn find_overlaps<T: Ord, K: Ord>(extents: &[Extent<T, K>]) -> Vec<bool>Expand description
Returns whether each extent intersects at least one other extent. Bounds are inclusive in both dimensions, so touching endpoints count as overlap.
Sorts the extents by start time once and sweeps them twice over one array-backed segment tree on the compressed key coordinates. The forward sweep finds each extent’s conflict with an earlier-starting extent: an extent that starts no later overlaps if, somewhere in its key range, an earlier extent ends at or after its start. The reverse sweep finds the conflict with a later-starting extent in the same way. Expired extents need no removal, since their bounds fail the comparison. Each sweep queries before it updates, so the cost is O(N log N), even when many extents overlap in time but have disjoint keys.