Interval Trees

# No interval in r overlaps search l for additional

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: l 4 L R Find All Overlapping Intervals • v.pt > r Intervals in v with li <= r overlap. No interval in R overlaps. Search L for additional overlapping intervals. l r v 4 L R Find All Overlapping Intervals • Complexity O(log n) nodes encountered All intervals in v overlap. Intervals in v with ri >= l overlap. Intervals in v with li <= r overlap. l • O(log n + |output|) when v.left and v.right are sorted arrays. r v 4 L R A Variant • i and j are two intervals. • i < j iff li < lj or (li = lj and ri > rj) i i j j i j A Variant • Red-black tree. • Each node has exactly one interval. • v.max = max (right) end point of intervals in subtree rooted at v. A Variant 1e 2 2 1 3 c 4 5 d 3 4 b 6 a 6 f 7 f,7 e,4 a,3 d,7...
View Full Document

## This note was uploaded on 02/04/2014 for the course COP 5536 taught by Professor Staff during the Summer '08 term at University of Florida.

Ask a homework question - tutors are online