arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 0901.1761cs.DS
收藏

走向最佳射程中值

Towards Optimal Range Medians

Beat Gfeller, Peter Sanders

摘要:

我们考虑以下问题:给定一个未排序的$n$元素数组,以及数组中的一个区间序列,计算由区间定义的每个子数组的中值。我们描述了一个简单的算法,它使用O(n)的空间,并需要$O(n\log k + k\log n)$时间来回答第一个$k$查询。这通过对数因子改进了先前的算法,并且匹配$k=O(n)$的下限。由于该算法分解的是元素值的范围而不是数组,因此它对高维问题具有自然的概括性-它将范围中值查询减少为对数数量的范围计数查询。

英文摘要:

We consider the following problem: given an unsorted array of $n$ elements, and a sequence of intervals in the array, compute the median in each of the subarrays defined by the intervals. We describe a simple algorithm which uses O(n) space and needs $O(n\log k + k\log n)$ time to answer the first $k$ queries. This improves previous algorithms by a logarithmic factor and matches a lower bound for $k=O(n)$. Since the algorithm decomposes the range of element values rather than the array, it has natural generalizations to higher dimensional problems -- it reduces a range median query to a logarithmic number of range counting queries.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑