We consider the problem of computing a sequence of range minimum queries. We assume a sequence of commands that contains values and queries. Our goal is to quickly determine the minimum value that exists between the current position and a previous position $i$. Range minimum queries are used as a sub-routine of several algorithms, namely related to string processing. We propose a data structure that can process these commands sequences. We obtain efficient results for several variations of the problem, in particular we obtain $O(1)$ time per command for the offline version and $O(\alpha(n))$ amortized time for the online version, where $\alpha(n)$ is the inverse Ackermann function and $n$ the number of values in the sequence. This data structure also has very small space requirements, namely $O(\ell)$ where $\ell$ is the maximum number active $i$ positions. We implemented our data structure and show that it is competitive against existing alternatives. We obtain comparable command processing time, in the nano second range, and much smaller space requirements.
翻译:我们考虑的是计算一系列最小范围查询的问题。 我们假设一系列包含值和查询的命令。 我们的目标是快速确定当前位置和先前位置之间的最低值。 最小范围查询被作为数种算法的子常规, 即与字符串处理有关。 我们提出一个能够处理这些命令序列的数据结构。 我们为问题的若干变异获得高效的结果, 特别是我们为离线版本获得每个命令的O(1)美元时间, 为在线版本获得美元( ALpha(n) ) 的摊销时间, 以美元( $) 为反阿尔法( n) 函数和序列中的数值。 这个数据结构的空间要求也非常小, 即$( ell), 美元是最大活动值为美元的位置。 我们实施了我们的数据结构, 并显示它与现有的替代方法相比具有竞争力。 我们获得了可比的指令处理时间, 在纳米第二范围, 并且空间要求要小得多。