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

有序范围报告与范围最小值查询

Sorted Range Reporting and Range Minima Queries

Waseem Akram, Sanjeev Saxena

AI总结:

针对有序范围选择问题,提出一种线性空间的最优权衡方案,预处理时间O(n)、查询时间O(k log k)且输出有序;同时给出一种接近线性时间的简单范围最小值查询方法,兼具实用性与效率。

摘要:

给定一个从有序集合中抽取的包含n个元素的数组A[1:n],有序范围选择问题旨在构建一种数据结构,用于高效回答以下类型的查询:给定索引对i,j(1≤i≤j≤n)和正整数k,按顺序报告子数组A[i:j]中的k个最小元素。Brodal等人(Brodal, G.S., Fagerberg, R., Greve, M., 和López-Ortiz, A.,《在线有序范围报告》,《算法与计算》(2009)第173-182页)提出了该问题并给出了最优解。经过O(n log n)时间的预处理后,查询时间为O(k),空间复杂度为O(n)。本文提出了该问题的另一种可能的最优权衡方案,即一种线性空间的解决方案,其范围选择查询的时间复杂度为O(k log k),预处理时间为O(n),且该算法能逐个输出非递减顺序的结果,简单实用。此外,我们还描述了一种极其简单的范围最小值查询方法(其大部分内容已知),该方法的时间复杂度接近(但不完全是)线性,我们认为在大多数情况下,该方法在实践中更快且更易于实现。

英文摘要:

Given an array A[1: n] of n elements drawn from an ordered set, the sorted range selection problem is to build a data structure that can be used to answer the following type of queries efficiently: Given a pair of indices i, j $ (1\le i\le j \le n)$, and a positive integer k, report the k smallest elements from the sub-array A[i: j] in order. Brodal et al. (Brodal, G.S., Fagerberg, R., Greve, M., and L{ó}pez-Ortiz, A., Online sorted range reporting. Algorithms and Computation (2009) pp. 173--182) introduced the problem and gave an optimal solution. After O(n log n) time for preprocessing, the query time is O(k). The space used is O(n). In this paper, we propose the only other possible optimal trade-off for the problem. We present a linear space solution to the problem that takes O(k log k) time to answer a range selection query. The preprocessing time is O(n). Moreover, the proposed algorithm reports the output elements one by one in non-decreasing order. Our solution is simple and practical. We also describe an extremely simple method for range minima queries (most of whose parts are known) which takes al most (but not exactly) linear time. We believe that this method may be, in practice, faster and easier to implement in most cases.

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

↑