Question: Given is a large paper with n different points with coordinates (x 1 , y 1 ),(x 2 , y 2 ), . . .
Given is a large paper with n different points with coordinates (x1, y1),(x2, y2), . . . ,(xn, yn). Notice that by folding the paper along a single line we can make some of the points align. For example, if the points are (1,2), (2,1), and (4,3), then if we fold along the line going through the origin at the 45 degree angle, the points (1,2) and (2,1) will align. Design an O(n2 log n) algorithm that finds the maximum number of pairs of points that can be aligned.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
