Given a set of 'n' points, I need to construct a circle enclosing the points(might not be the smallest enclosing circle) given that minimum of 2 points lie on the circle. I want to find the result in order of 'n' time complexity.
What I tried: I tried by first finding the maximum and minimum x-coordinate and finding the distance between them and then repeating the same for y-coordinate. Then I found out the maximum distance out of the two(between x_min and x_max and between y_min and y_max). For the pair for which I got the maximum distance, I found the euclidean distance and took that as the diameter, and constructed the circle around it. For eg. if I found the maximum distance between x_min and x_max, I calculated the euclidean distance between (x_min,y1) and (x_min,y2) and considered it as the diameter.
But that seems to not work !!