Question: (60 pts) Give an efficient algorithm to find the closest pair (please see the explanation below) in an arbitrary array (25 pts). You may write

(60 pts) Give an efficient algorithm to find the closest pair (please see the explanation below) in an arbitrary array (25 pts). You may write your algorithm in pseudocode. And perform the runtime analysis line by line analysis as I did in the video tutorials under Module 1 (25 pts). Also, write C++ code for the given problem. Create random arrays size of N={10, 100,1000}. Then report your timings in terms of microseconds (10pts). Does your real-time (experimental) timing support theoretical complexity analysis? Why/Why not? *** Closest Pair Problem: Assume that A = [a1,a2,a3,...,an] is an integer array and A is not a sorted. Closest pair of A is the two values from A where the absolute value of |ai-aj| is minimum.

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!