Let A be a set of n points in the two-dimension plane. We would like to find the
ID: 3564183 • Letter: L
Question
Let A be a set of n points in the two-dimension plane. We would like to find the distance of a closest pair in A, using the following badClosestpair algorithm.
We first randomly split A into two subsets A1 and A2, in linear time. Then, we run badClosestpair on A1 and on A2. As a result, we obtain the distance d1 of a closest pair in A1 and the distance d2 of a closest pair in A2. Finally, for each point in A1 and each point in A2, we calculate the distance between the two points and pick the smallest d among all these distances. The result of badClosestpair running over A returns as min(d1, d2, d).
Compute the average-case time complexity of badClosestpair.
Explanation / Answer
I thnk u can have a btr look here..
http://www.geeksforgeeks.org/closest-pair-of-points/ #copied as explained well enough.
for good algo u can check this one.
http://www.geeksforgeeks.org/closest-pair-of-points-onlogn-implementation/ #copied as explaied well enough.
If you need any further help please let me know.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.