Question: Closest Points (version 1): Consider the closest points problem (which turns out to be a fundamental subroutine in many-an-algorithm 2 ). In this case, the

 Closest Points (version 1): Consider the "closest points" problem (which turns

Closest Points (version 1): Consider the "closest points" problem (which turns out to be a fundamental subroutine in many-an-algorithm 2 ). In this case, the input consists of a set S of n points, each of which is of the form (x,y)RR. In the "closest points" problem, the goal is to find the pair of points in S that are as close as possible (using the standard distance formula). Here is a sample input of size 4 : S={(1,1),(100,40),(4,5),(80,42.42)} In this case, the closest two points are (1,1) and (4,5) at a distance of (41)2+(51)2=9+16=25=5. (a) Write pseudo-code for a "brute-force" algorithm (one that checks all pairs and picks the smallest) (b) Prove that your algorithm is correct (this will not be a particularly lengthy proof) (c) Count the number of atomic operations 3 and give the big-O running time. You do not need to prove your big-O answer (you've had enough practice!) but should clearly explain and justify your accounting of atomic operations

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!