MIT6_851S10_assn02_sol

MIT6_851S10_assn02_sol - Also, we can just project the...

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

View Full Document Right Arrow Icon
6.851 Advanced Data Structures (Spring’10) Prof. Erik Demaine Dr. Andr´ e Schulz TA: Aleksandar Zlateski Problem 2 Sample Solutions Query Time for kd -trees. Let’s consider an intersections along one edge, either vertical or horizontal, and the next intersection (horizontal or vertical). Note that the number of regions doubles after two levels of intersections, hence the depth of the kd -tree is d = log 2 n . Summing up all the intersections at all depths we get that the total number of regions intersected is O ( n ). For the part 2, we can just arrange the points on the n by n lattace. Segment Stabbing Note that there is no limit on the memory used. Therefore we can just use a midi±ed segment tree.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Also, we can just project the points to the x axis and for each obtained interval (at most n 2 of them, in the case of intersecting points) we store all the intersecting segments sorted by the y coordinate. This way we can answer both queries in O ( k + log n 2 ) = O ( k + log n ). 1 MIT OpenCourseWare http://ocw.mit.edu 6.851 Advanced Data Structures Spring 2010 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms ....
View Full Document

Page1 / 2

MIT6_851S10_assn02_sol - Also, we can just project the...

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

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