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 3 — February 9, 2010 Dr. Andr´ e Schulz 1 Overview In the last lecture we continued to study binary search trees from the geometry perspective of arboreally satisfied sets. We gave lower bounds for the runtime of a BST — two of them were Wilbur’s lower bounds [Wil89], and the last was “signed greedy.” We also looked at a type of BST called a Tango tree and showed that it was O (lg lg n ) competitive with an optimal dynamic tree. In this lecture we consider the problem of orthogonal range queries, focusing mostly on R 2 but also indicating how to extend the results to higher dimensions. An orthogonal range query is the following problem: given a set S of points in R d , and an axisaligned box B , what are all elements of S that lie in B ? The goal is to implement a data structure with reasonably eﬃcient preprocessing on the set S that can answer all such queries eﬃciently. A natural application is to database queries (e.g. how many people lie in a given age range and income range?). Since the output of a query could be very large, we will measure the eﬃciency of our data structures in terms of both n , the number of points in S , and k , the size of the output of a given query. We start by introducing range trees, which in the twodimensional case use O ( n lg n ) space and pre processing time and have a query time of O (lg 2 n + k ). (In d dimensions, they use O ( n lg d − 1 n ) storage and preprocessing and have a query time of O (lg d n + k ).) We then describe kdtrees for the 2dimensional case, which are more storageeﬃcient ( O ( n ) space), but have a bad worstcase query time O ( √ n ). We also introduce the idea of fractional cascading, a trick that reduces the query time for range trees from O (lg d n + k ) to O (lg d − 1 n + k ). Finally, we indicate how to deal with the case of points with duplicated coordinates (the rest of the exposition assumes that all points have distinct coordinates). A good reference for the material in this lecture is the book Computational Geometry: Algorithms and Applications by deBerg et al. [dBea08]. We begin by describing the problem of orthogonal range queries in detail. We will then look at various data structures for answering orthogonal range queries eﬃciently. 2 Orthogonal Range Queries The first problem we will approach is orthogonal range searching . Suppose we are given a set of points. For the moment we will assume that these points are in R 2 , but in general we can allow our space to be any dimension. Now draw a rectangle with sides parallel to the coordinate axes (since this is orthogonal range searching, we require a rectangle, although in principle we could allow other shapes). How can we report all of the points that are inside of the rectangle?...
View
Full
Document
This note was uploaded on 03/31/2011 for the course EECS 6.851 taught by Professor Erikdemaine during the Spring '10 term at MIT.
 Spring '10
 ErikDemaine
 Binary Search, Data Structures

Click to edit the document details