This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 6.851: Advanced Data Structures Spring 2010 Lecture 4 11 February, 2010 Dr. Andr e Schulz Scribe: Cai GoGwilt 1 Overview In the last lecture we discussed the orthogonal range query problem and solutions to it. In the orthogonal range query problem, we are given a set of points and a rectangular area, and are asked to report the points that lie in this area. We discussed three types of solutions: range trees, kdtrees (in the 2D case), and fractional cascading. In this lecture we briefly discuss extending our orthogonal range query solutions to account for dynamic point sets. We then introduce the problem of vertical line stabbing queries, present two solutions, and review an application. 2 Orthogonal Range Queries and Dynamic Point Sets In our discussion of the orthogonal range query problem in lecture 3, we only considered static point sets. What costs are associated with modifying the point set as we do the queries? In other words, what if we modify our data structure to handle dynamic point sets? In The Design of Dynamic Data Structures, Mark H. Overmars discusses ideas and costs associated with turning a static data structure into a dynamic one.[1] The orthogonal range query problem entails decomposable searches. This means we can partition queries, q , on keys, x , into queries on subsets of x : ( x, q ) partitions into ( x 1 , q ) and ( x 2 , q ) where x 1 x 2 = x . In this case, insertions take O ( T b n log n ) amortized time (where T b is the data structure build time), and queries grow by a log n factor. Thus, for our dynamic 2D rangetrees, queries will take O (log 2 n + k ) time and insertions will take O (log 2 n ) time. 3 Vertical Line Stabbing Queries In the vertical line stabbing queries problem, we are given, as input, n intervals: I = { [ a 1 , b 1 ] , [ a 2 , b 2 ] , . . . , [ a n , b n ] } , and a query q R . Our task is to report all intervals that contain q . 1 4 IntervalTree The intervaltree uses the idea of divideandconquer. We divide the intervals into sets based on their relation to the median of the interval endpoints. Some will lie completely to the left or right of the median, and others will intersect. We will recurse on the intervals that lie to the left or right.of the median, and others will intersect....
View
Full
Document
 Fall '10
 ErikDemaine
 Data Structures

Click to edit the document details