Question: Were given n points p1 = (x1, y1), p2 = (x2, y2), ...,pn = (xn, yn) on plane; all coordinates are integers. We would like

Were given n points p1 = (x1, y1), p2 = (x2, y2), ...,pn = (xn, yn) on plane; all coordinates are integers. We would like to know if there are any two points on the same vertical line or horizontal line. Give a linear time algorithm using hashing we assume that insert and search operations take O(1) time each.

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!