This assignment requires you to “construct an algorithm”. There are, of course, many algorithms solving this problem. Some algorithms are asymptotically more efficient than others. Your objectives are to (a) complete the assignment, and (b) submit an asymptotically efficient algorithm.
1. Conditions
(a) Consider a set, P, of ri points, (xi, Yi),…1 (xn, Yn), in a two dimensional plane. (b) A metric for the distance between two points (xi, y2) and (xj, kJ) in this plane is the Euclidean distance -V(xi xi)2 + (yi — Y3)2-
2. Closest Pairs [90 points] (a) [40 points] Construct an algorithm for finding the m
i. [25 points] Define your algorithm using pseudocode. ii. [15 points] Determine the worst-case running time (page 25) of your algorithm (call this the algo-rithm’s worst-case running time). (b) [20 points] Implement your algorithm. Your code must have a reasonable, consistent, style and docu-mentation. It must have appropriate data structures, modularity, and error checking. (c) [10 points] Perform and submit trace runs demonstrating the proper functioning of your code. (d) [10 points] Perform tests to measure the asymptotic behavior of your program (call this the code’s worst-case running time). (e) [10 points] Analysis comparing your algorithm’s worst-case running time to your code’s worst-cast running time.
3. Retrospection [10 points]
(a) [10 points] Now that you have designed, implemented, and tested your algorithm, what aspects of your algorithm and/or code could change and reduce the worst-case running time of your algorithm? Be specific in your response to this question.
#Sales Offer!| Get upto 25% Off: