lec04 - Spring 2010 6.851 Advanced Data Structures Lecture...

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

View Full Document Right Arrow Icon
6.851: Advanced Data Structures Spring 2010 Lecture 4 — February 11, 2010 Prof. Andr´ e Schulz Scribe: Peter Caday 1 Overview In the previous lecture, we studied range trees and kd-trees, two structures which support efcient orthogonal range queries on a set oF points. In this second oF Four lectures on geometric data structures, we will tie up a loose end From the last lecture — handling insertions and deletions. The main topic, however, will be two new structures addressing the vertical line stabbing problem: interval trees and segment trees. We will conclude with an application oF vertical line stabbing to a windowing problem. 2 Dynamization In our previous discussion oF range trees, we assumed that the point set was static. On the other hand, we may be interested in supporting insertions and deletions as time progresses. UnFortunately, it is not trivial to modiFy our data structures to handle this dynamic scenario. We can, however, dynamize them using general techniques; the techniques and their application here are due to Overmars [1]. Idea. Overmars’ dynamization is based on the idea oF decomposable searches . A search ( X,q ) For the value q among the keys X is decomposable iF the search result can be obtained in O (1) time From the results oF searching ( X 1 ,q ) and ( X 2 ,q ), where X 1 X 2 = X . ±or instance, in the 2D kd-tree, the root node splits R 2 into two halves. IF we want to search For all points lying in a rectangle q , we may do this by combining the results oF searching For q in each halF. Results. We will bypass the actual dynamization method, and just give the results. Insertion: O ((log n ) T b /n ), where T b is the build time , the time required to build the static tree Query: time increases by a log n Factor Note that this is a general result, which applies to any data structure with a decomposable search. As a concrete example, here are the times For a dynamic 2D range tree: Insertion: O (log 2 n + k ), where k is the size oF the output, as always Query: O (log 2 n ) We have only mentioned insertion time here; deletions are more complicated. 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
3 Vertical line stabbing We now move to the main focus of this lecture. In the vertical line stabbing problem, the input is a collection I = { [ a 1 ,b 1 ] , [ a 2 ,b 2 ] ,... } of n closed intervals. We wish to be eFciently report, for any q R , the intervals containing q . The name “vertical line stabbing” derives from one way to visualize the problem: q 3.1 Interval Tree Idea. One way to address the problem is through a divide-and-conquer approach. Consider the median m of the 2 n endpoints in I . Some intervals may lie entirely to the left of m , some entirely to the right, and some may cross m . Thos to the left and to the right can be dealt with recursively.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/20/2012 for the course CS 6.849 taught by Professor Erikdemaine during the Fall '10 term at MIT.

Page1 / 7

lec04 - Spring 2010 6.851 Advanced Data Structures Lecture...

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

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