# ps2 - 1. Develop a data structure that can report all s ∈...

This preview shows page 1. Sign up to view the full content.

6.851 Advanced Data Structures (Spring’10) Prof. Erik Demaine Dr. Andr´ e Schulz TA: Aleksandar Zlateski Problem 2 Due: Thursday, Feb. 18 Be sure to read the instructions on the assignments section of the class web page. Query time kd-trees. We consider a kd-tree that stores n points in the plane. Every node v of the kd-tree represents a region region ( v ) in the induced subdivision of the plane. 1. Show that the boundary of an (axis-parallel) query rectangle can intersect at most O ( n ) such regions. 2. Show that Ω( n ) is a lower bound for the maximal number of regions that intersect the boundary of an axis-parallel query rectangle by deﬁning a set of n points and a query rectangle appropriately. Segment stabbing. Let S be a set of disjoint line segments in the plane.
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1. Develop a data structure that can report all s ∈ S that are hit by a vertical ray emanating from ( x,y ) towards ∞ , that is Above ( x , y ) := { s ∈ S | s ∩ { ( x , y ) | y ≤ y } 6 = ∅} . Query times should be O (log n + k ). 2. Develop a data structure that can report all s ∈ S that are hit by a line segment with endpoints ( x,y 1 ) and ( x,y 2 ), that is Between ( x , y 1 , y 2 ) := { s ∈ S | s ∩ { ( x , y ) | y 1 ≤ y ≤ y 2 } 6 = ∅} Query times should be O (log 2 n + k ). Hint: Modify a segment tree. ( x,y ) ( x,y 1 ) ( x,y 2 ) Above ( x , y ) Between ( x , y 1 , y 2 ) Figure 1: Illustration what the queries should report (thick lines). 1...
View Full 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.

Ask a homework question - tutors are online