This preview shows pages 1–11. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Segment trees and interval trees Lekcija 11 Sergio Cabello sergio.cabello@fmf.unilj.si FMF Univerza v Ljubljani Includes slides by Antoine Vigneron Sergio Cabello RC More trees Outline trianglerightsld segment trees stabbing queries windowing problem rectangle intersection Klees measure problem trianglerightsld interval trees improvement for some problems trianglerightsld higher dimension Sergio Cabello RC More trees 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 (axisparallel) boxes query: report the k boxes that contain a query point q Sergio Cabello RC More trees 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 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 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 Klees 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 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 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 Atomic intervals trianglerightsld...
View
Full
Document
This note was uploaded on 02/12/2011 for the course CSE 355 taught by Professor Mitchell,j during the Spring '08 term at SUNY Stony Brook.
 Spring '08
 Mitchell,J

Click to edit the document details