MIT6_851S10_lec03

# MIT6_851S10_lec03 - 6.851 Advanced Data Structures Spring...

This preview shows pages 1–2. Sign up to view the full content.

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 axis-aligned 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 two-dimensional 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 pre-processing and have a query time of O (lg d n + k ).) We then describe kd-trees for the 2-dimensional case, which are more storage-eﬃcient ( O ( n ) space), but have a bad worst-case 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?

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• 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.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern