Algorithm to find 100 closest stars to the origin

后端 未结 5 720
花落未央
花落未央 2021-01-31 11:34

First let me phrase the proper question:

Q: There is a file containing more than a million points (x,y) each of which represents a star. There is a planet earth

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-31 12:21

    It's a famous question and there has been lot's of solution for that: http://en.wikipedia.org/wiki/K-nearest_neighbor_algorithm

    if you did not find it useful, there are some other resources such as Rurk's computational geometry book.

提交回复
热议问题