找最近的点,这题咋解?# JobHunting - 待字闺中
h*g
1 楼
You are given a list of points in the plane, write a program that
outputs each point along with the point that are closest
to it.
The order is less then O(n^2) .
For example, given a set of points where each line is of the form:
ID x-coordinate y-coordinate
1 0.0 0.0
2 10.1 -10.1
3 -12.2 12.2
4 38.3 38.3
5 79.99 179.99
Your program should output:
1 2
2 1
3 1
4 1
5 4
outputs each point along with the point that are closest
to it.
The order is less then O(n^2) .
For example, given a set of points where each line is of the form:
ID x-coordinate y-coordinate
1 0.0 0.0
2 10.1 -10.1
3 -12.2 12.2
4 38.3 38.3
5 79.99 179.99
Your program should output:
1 2
2 1
3 1
4 1
5 4