{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

SegmentTreeAndIntervalTree

SegmentTreeAndIntervalTree - Segment trees and interval...

Info icon This preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
Segment trees and interval trees Lekcija 11 Sergio Cabello [email protected] FMF Univerza v Ljubljani Includes slides by Antoine Vigneron Sergio Cabello RC – More trees
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
Outline trianglerightsld segment trees stabbing queries windowing problem rectangle intersection Klee’s measure problem trianglerightsld interval trees improvement for some problems trianglerightsld higher dimension Sergio Cabello RC – More trees
Image of page 2
Data structure for stabbing queries trianglerightsld orthogonal range searching: data is points, queries are rectangles trianglerightsld stabbing problem: data is rectangles, queries are points trianglerightsld in one dimension data: a set of n intervals query: report the k intervals that contain a query point q trianglerightsld in R d data: a set of n isothetic (axis-parallel) boxes query: report the k boxes that contain a query point q Sergio Cabello RC – More trees
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
Motivation trianglerightsld in graphics and databases, objects are often stored according to their bounding box Object Bounding box trianglerightsld query: which objects does point x belong to? trianglerightsld first find objects whose bounding boxes contain x trianglerightsld then perform screening Sergio Cabello RC – More trees
Image of page 4
Data structure for windowing queries trianglerightsld windowing queries data: a set of n disjoint segments in R 2 query: report the k segments that intersect a query rectangle R . trianglerightsld motivation: zoom in maps Sergio Cabello RC – More trees
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
Rectangle intersection trianglerightsld input: a set B of n isothetic boxes in R 2 trianglerightsld output: all the intersecting pairs in B 2 b 4 b 3 b 1 b 2 b 5 trianglerightsld output: ( b 1 , b 3 ),( b 2 , b 3 ),( b 2 , b 4 ),( b 3 , b 4 ) Sergio Cabello RC – More trees
Image of page 6
Klee’s measure problem trianglerightsld input: a set B of n isothetic boxes trianglerightsld output: the area/volume of the union trianglerightsld well understood in R 2 O ( n log n ) time trianglerightsld the union can have complexity Θ( n 2 ). Example? trianglerightsld poorly understood in R d for d > 2 Sergio Cabello RC – More trees
Image of page 7

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

View Full Document Right Arrow Icon
Segment tree trianglerightsld a data structure to store intervals, or segments trianglerightsld allows to answer stabbing queries in R 2 : report the segments that intersect a query vertical line l in R : report the segments that intersect a query point reported reported reported l query time: O (log n + k ) space usage: O ( n log n ) preprocessing time: O ( n log n ) Sergio Cabello RC – More trees
Image of page 8
Notations trianglerightsld let S = ( s 1 , s 2 ,... s n ) be a set of segments in R trianglerightsld let E be the set of the x –coordinates of the endpoints of the segments of S trianglerightsld we assume general position, that is: | E | = 2 n trianglerightsld first sort E in increasing order trianglerightsld E = { e 1 < e 2 < · · · < e 2 n } Sergio Cabello RC – More trees
Image of page 9

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

View Full Document Right Arrow Icon
Atomic intervals trianglerightsld E splits R into 2 n + 1 atomic intervals: [ -∞ , e 1 ] [ e i , e i +1 ] for i ∈ { 1 , 2 ,... 2 n - 1 } [ e 2 n , ]
Image of page 10
Image of page 11
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