Question: Given a list of coordinate points write a python program to create two new lists where each list contains the closest points. That is the


Given a list of coordinate points write a python program to create two new lists where each list contains the closest points. That is the points in each list are close to each other and far from the other list points. For example is the given list is [(2,1). (6,2)((1,2)(7.7), (2,3). (8,10),(3,1)) then the new lists are [(1, 2), (2, 1), (2, 3), (3, 1)] and [(6, 2), (7, 7), (8, 10)] Input Format Number of points N x-coordinate of point 1 y-coordinate of point 1 x-coordinate of point 2 y-coordinate of point 2 x-coordinate of point N y-coordinate of point N Output Format First list of nearest points Output Format First list of nearest points Second list of nearest points case=1 input=7 21 62 12 77 23 8 10 31 output=[(1, 2), (2, 1), (2, 3), (3, 1)] [(6,2), (7, 7), (8, 10)]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
