lec34 - Interval Trees i i i i Store intervals of the...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Interval Trees Store intervals of the form [ l i ,r i ], l i <= r i . Insert and delete intervals. Version 1 Answer queries of the form: which intervals intersect/overlap a given interval [ l ,r] . Version 2—Variant Report just 1 overlapping interval.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Definition—Version 1 A binary tree. Each node v has a point v.pt and two lists v.left and v.right . u.pt < v.pt for nodes u in left subtree of v . u.pt > v.pt for nodes u in right subtree of v . So, it is a binary search tree on pt .
Background image of page 2
Definition—Version 1 Intervals with r i < v.pt are stored in the left subtree of v . Intervals with l i > v.pt are stored in the right subtree of v . i i
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Example v.pt = 4 L = {a, e} R = {d} 1 e 1 3 a 2 4 c 4 6 b 3 6 f 5 7 d 2 4 L R v v.left = {c, f, b} v.right = {c,b,f}
Background image of page 4
Each interval is stored in exactly one node. Each node stores between 1 and n intervals. Number of nodes is O(n) . Sum of sizes of
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 23

lec34 - Interval Trees i i i i Store intervals of the...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online