Question: please help me to solve this question, I will give upvote for your effort. 3: 4: Given a set of n points in the plane,

 please help me to solve this question, I will give upvote

please help me to solve this question, I will give upvote for your effort.

3: 4: Given a set of n points in the plane, let the loneliest point be the point which is furthest away from all other points. There could be multiple loneliest points if there are ties; e.g. in a set of two points both are loneliest. Suppose we tried to find a loneliest point using divide-and-conquer in the following way: 1: function FIND-LONELIEST(a list P of n points) 2: Sort P in order of increasing x coordinate (say breaking ties with the y coordinate) p,dp + HELPER(P) return p 5: function HELPER(P(0..n - 1]) 6: # Return a loneliest point in P and its distance to the nearest point. 7: if n=1 then return (P[0],-) m+ n/2] 9: left-points + P(0..m-1] 10: right points + P[m..n-1] 11: l,de + HELPER(left-points) #Recursively find loneliest points in left and right halves 12: r,d, + HELPER(right points) 13: d - min(de, min peright-points d(l, p)) # Check distance from 1 to all points on right 14: dr + min(d,, min peleft-points d(r,p)) # Check distance from r to all points on left 15: if de > d, then return (2,de) # Return whichever of lor r is lonelier 16: else return (r,dr) 8: (a) What is the asymptotic runtime of this algorithm? Justify your answer, explaining how long each of the steps of the algorithm takes. (b) Unfortunately, this algorithm doesn't work! Explain the reason why the algorithm can go wrong, and give an example set of points where it returns a non-loneliest point

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!