问题描述
我正在寻找一种算法或数据结构来解决以下问题:您会得到一组分数S.您还会得到另一种形式的Q查询.对于每个查询,从给定点中查找集合中最远的点.
I'm looking for an algorithm or data structure to solve the following problem:You are given a set of points S.And you are given Q queries in form of another point.For every query, find the farthest point in the set from the given point.
该集合中最多有10 ^ 5个点,并且有10 ^ 5个查询.点的所有坐标都在0到10 ^ 5之间.
There are at most 10^5 points in the set and 10^5 queries. All the coordinates for points are in range from 0 to 10^5.
我想知道是否有一种方法可以存储点集,以便我们可以在必要时以O(log n)或O(log ^ 2 n)回答查询.
I am wondering if there is a way to store the set of points such that we can answer the queries in O(log n) or O(log^2 n) if necessary.
推荐答案
引自应用程序中最远的邻居"到环形查询":
A quote from "Approximate Furthest Neighbor with Applicationto Annulus Query":
其中[5]是指商标教科书":
where [5] refers to the "Marks textbook":
这篇关于如何有效地找到给定点的最远点(从一组点中)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!