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

Info icon This 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.
Image of page 1

Info icon This 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 .
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 . Intervals with l i <= v.pt <= r i are stored in v . v.left has these intervals sorted by l i . v.right has these intervals sorted by r i .
Image of page 3

Info icon This 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}
Image of page 4
Properties Each interval is stored in exactly one node. Each node stores between 1 and n intervals.
Image of page 5

Info icon This 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 ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern