Question: Use C/C++ ONLY and include how to run the program 1. [12%] Implement the algorithm for finding the closest pair of points in two dimension
Use C/C++ ONLY and include how to run the program![Use C/C++ ONLY and include how to run the program 1. [12\%]](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3aec4dbf65_02066f3aec45bf0a.jpg)

1. [12\%] Implement the algorithm for finding the closest pair of points in two dimension plane using divide and conquer strategy. A system for controlling air or sea traffic might need to know which are the two closest vehicles in order to detect potential collisions. This part solves the problem of finding the closest pair of points in a set of points. The set consists of points in R2 defined by both an x and a y coordinate. The "closest pair" refers to the pair of points in the set that has the smallest Euclidean distance, where Euclidean distance between points p1=(x1,y1) and p2=(x2,y2) is simply sqrt ((x1x2)2+(y1y2)2). If there are two identical points in the set, then the closest pair distance in the set will obviously be zero. Input data: n points with coordinates: X coordinates: p[0]x,p[1]x,p[2]x,.,p[n]x Y coordinates: p[0]y,p[1]y,p[2]y,.,p[n]y Output: minimum distance between points p[i and p[j ] (index i and j should be identified) Input data for test: n=10000; for(i=0;ip[i]x=ni; p[i]y=ni; \} Other Input data for test: n=10000; for(i=0;ip[i]x=ii; p[i]y=ii; \} Or: Input: If X>0 X=1,3,5,7,9,11,13,15,17,19,21,23,,19995,19997,19999 (odd numbers) Y=int(99992(X10000)2) Else X=0,2,4,6,8,10,12,,19996,19998,20000 (even number) Y=int(100002(X+10000)2)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
