lecture12

lecture12 - Introduction to Algorithms...

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

Introduction to Algorithms 6.046J/18.401J/SMA5503 Lecture 12 Prof. Erik Demaine

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

View Full Document
Introduction to Algorithms Day 21 L12.2 © 2001 by Erik D. Demaine Computational geometry Algorithms for solving “geometric problems” in 2D and higher. Fundamental objects: point line segment line Basic structures: polygon point set
Introduction to Algorithms Day 21 L12.3 © 2001 by Erik D. Demaine Computational geometry Algorithms for solving “geometric problems” in 2D and higher. Fundamental objects: point line segment line Basic structures: convex hull triangulation

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

View Full Document
Introduction to Algorithms Day 21 L12.4 © 2001 by Erik D. Demaine Orthogonal range searching Input: n points in d dimensions E.g., representing a database of n records each with d numeric fields Query: Axis-aligned box (in 2D, a rectangle) Report on the points inside the box: Are there any points? How many are there? List the points.
Introduction to Algorithms Day 21 L12.5 © 2001 by Erik D. Demaine Orthogonal range searching Input: n points in d dimensions Query: Axis-aligned box (in 2D, a rectangle) Report on the points inside the box Goal: Preprocess points into a data structure to support fast queries Primary goal: Static data structure In 1D, we will also obtain a dynamic data structure supporting insert and delete

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

View Full Document
Introduction to Algorithms Day 21 L12.6 © 2001 by Erik D. Demaine 1D range searching In 1D, the query is an interval: First solution using ideas we know: Interval trees Represent each point x by the interval [ x , x ] . Obtain a dynamic structure that can list k answers in a query in O( k lg n ) time.
Introduction to Algorithms Day 21 L12.7 © 2001 by Erik D. Demaine 1D range searching In 1D, the query is an interval: Second solution using ideas we know: Sort the points and store them in an array Solve query by binary search on endpoints. Obtain a static structure that can list k answers in a query in O( k + lg n ) time. Goal: Obtain a dynamic structure that can list k answers in a query in O( k + lg n ) time.

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

View Full Document
Introduction to Algorithms Day 21 L12.8 © 2001 by Erik D. Demaine 1D range searching In 1D, the query is an interval: New solution that extends to higher dimensions: Balanced binary search tree New organization principle:
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/09/2009 for the course CSE 6.046J/18. taught by Professor Piotrindykandcharlese.leiserson during the Fall '04 term at MIT.

Page1 / 28

lecture12 - Introduction to Algorithms...

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

View Full Document
Ask a homework question - tutors are online