MIT6_851S10_assn03_sol

MIT6_851S10_assn03_sol - time spent searching the WBBST for...

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 3 Sample Solutions Ray Shooting in Simple Polygons With every step we reduce the WBBST total weight of the current subtree by at least a factor of 2. We Fnish once we reach a subtree with weight ω i . Hence, we solve the recurrence T ( ω ) = 1 + T ( ω/ 2). The base case is T ( ω i ) = 1, so we get T (Ω) = O (1 + log i )). Suppose each concave chain in the balanced pseudo-triangulation is stored in a WBBST, where the weight of an edge i equals the number edges in the opposing polygon ω i . We consider two adjacent pseudo-triangles, t a and t b , crossed by the ray in this algorithm. Let i be the edge the ray crosses to move from t a into t b . In t b the ray homes-in on the next edge it crosses, i + 1, in a concave chain, which has at most ω i edges, and so the total
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: time spent searching the WBBST for the home-in chain in tb is O (log( i / i +1 )). The sum telescopes, and its result is the dierence in the logs of two pseudo-triangle sizes, which is no larger than O (log n ). The ray-shooting algorithm traverses no more than O (log n ) triangles in total, giving the total runtime of O (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_assn03_sol - time spent searching the WBBST for...

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