CG_RangeTrees - Introduction 2D Range trees Degenerate...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Introduction 2D Range trees Degenerate cases Range trees Computational Geometry Lecture 8: Range trees Computational Geometry Lecture 8: Range trees Introduction 2D Range trees Degenerate cases Range queries Database queries A database query may ask for all employees with age between a 1 and a 2 , and salary between s 1 and s 2 date of birth salary 19,500,000 19,559,999 G. Ometer born: Aug 16, 1954 salary: $3,500 Computational Geometry Lecture 8: Range trees Introduction 2D Range trees Degenerate cases Range queries Result Theorem: A set of n points on the real line can be preprocessed in O ( n log n ) time into a data structure of O ( n ) size so that any 1D range counting query can be answered in O ( log n ) time Computational Geometry Lecture 8: Range trees Introduction 2D Range trees Degenerate cases Range queries Result Theorem: A set of n points in the plane can be preprocessed in O ( n log n ) time into a data structure of O ( n ) size so that any 2D range query can be answered in O ( √ n + k ) time, where k is the number of answers reported For range counting queries, we need O ( √ n ) time Computational Geometry Lecture 8: Range trees Introduction 2D Range trees Degenerate cases Range queries Faster queries Can we achieve O ( log n ) query time? Computational Geometry Lecture 8: Range trees Introduction 2D Range trees Degenerate cases Range queries Faster queries Can we achieve O ( log n ) query time? Computational Geometry Lecture 8: Range trees Introduction 2D Range trees Degenerate cases Range queries Faster queries If the corners of the query rectangle fall in specific cells of the grid, the answer is fixed (even for lower left and upper right corner) Computational Geometry Lecture 8: Range trees Introduction 2D Range trees Degenerate cases Range queries Faster queries Build a tree so that the leaves correspond to the different possible query rectangle types (corners in same cells of grid), and with each leaf, store all answers (points) Build a tree on the different x-coordinates (to search with left side of R ), in each of the leaves, build a tree on the different x-coordinates (to search with the right side of R ), in each of the leaves, ... Computational Geometry Lecture 8: Range trees Introduction 2D Range trees Degenerate cases Range queries Faster queries n n n n Computational Geometry Lecture 8: Range trees Introduction 2D Range trees Degenerate cases Range queries Faster queries Question: What are the storage requirements of this structure, and what is the query time? Computational Geometry Lecture 8: Range trees Introduction 2D Range trees Degenerate cases Range queries Faster queries Recall the 1D range tree and range query: Two search paths (grey nodes) Subtrees in between are full of answers (black) Computational Geometry Lecture 8: Range trees Introduction 2D Range trees Degenerate cases Range queries Example 1D range query A 1-dimensional range query with [ 25 , 90 ] 3 10 19 23 30 37 59 62 70 80 89 3 19 10 30 59 70 62 93 89 80 23 49 93 97 37 49 Computational Geometry Lecture 8: Range trees Introduction...
View Full Document

This note was uploaded on 05/27/2011 for the course CIS 4930 taught by Professor Staff during the Fall '08 term at University of Florida.

Page1 / 61

CG_RangeTrees - Introduction 2D Range trees Degenerate...

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

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