Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 33 CSE 331 Nov 20, 2009. Homeworks Submit HW 9 by 1:10PM HW 8 solutions at the end of the lecture.

Similar presentations


Presentation on theme: "Lecture 33 CSE 331 Nov 20, 2009. Homeworks Submit HW 9 by 1:10PM HW 8 solutions at the end of the lecture."— Presentation transcript:

1 Lecture 33 CSE 331 Nov 20, 2009

2 Homeworks Submit HW 9 by 1:10PM HW 8 solutions at the end of the lecture

3 Closest pairs of points Input: n 2-D points P = {p 1,…,p n }; p i =(x i,y i ) Output: Points p and q that are closest d(p i,p j ) = ( (x i -x j ) 2 +(y i -y j ) 2 ) 1/2

4 Some simple observations Brute force algorithm takes O(n 2 ) time 1-D problem can be solved by sorting in time O(n log n)

5 Sorting to rescue in 2-D? Pick pairs of points closest in x co-ordinate Pick pairs of points closest in y co-ordinate Choose the better of the two

6 Today’s agenda Divide and Conquer based algorithm

7 Homeworks Submit HW 9 by 1:10PM


Download ppt "Lecture 33 CSE 331 Nov 20, 2009. Homeworks Submit HW 9 by 1:10PM HW 8 solutions at the end of the lecture."

Similar presentations


Ads by Google