Lecture 33 CSE 331 Nov 20, 2009
Homeworks Submit HW 9 by 1:10PM HW 8 solutions at the end of the lecture
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
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)
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
Today’s agenda Divide and Conquer based algorithm
Homeworks Submit HW 9 by 1:10PM