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

最快最长的过山车

Fast and Longest Rollercoasters

Paweł Gawrychowski, Florin Manea, Radosław Serafin

摘要:

对于$k\geq 3$,k-过山车是一个数序列,其每个最大连续子序列,即增加或减少,长度至少为$k$ ; $3$ -过山车被称为简单的过山车。给定一个不同数字的序列,我们感兴趣的是计算它的最大长度(不一定是连续的)子序列,这是一个$k$ -过山车。Biedl等人[ICALP 2018]已经证明,$n$不同实数的每个序列都包含一个长度至少为$n>7$的$\lceil n/2\rceil$的过山车,并且可以在$O(n\log n)$时间内计算此类序列中包含的最长过山车。他们还证明了$n\geq (k-1)^2+1$不同实数的每个序列都包含一个长度至少为$\frac{n}{2(k-1)}-\frac{3k}{2}$的$k$ -过山车,并给出了一个计算长度为$n$的序列中最长$k$ -过山车的$O(nk\log n)$ -时间算法。在本文中,我们给出了一个$O(nk^2)$ -时间算法计算的长度最长的$k$ -过山车包含在一个序列的$n$不同的实数;因此,对于常数$k$,我们的算法计算的长度最长的$k$ -过山车在最佳线性时间。该算法可以很容易地适应输出各自的$k$ -过山车。特别是,这改进了Biedl等人的结果。[ICALP 2018],通过显示可以在最佳线性时间内计算最长的过山车。我们还提出了一个算法计算的长度最长的$k$ -过山车在$O(n \log^2 n)$ -时间,即次二次,即使大值的$k\leq n$。再次,过山车可以很容易地检索。最后,我们显示了一个$Ω(n \log k)$下界的数量比较在任何比较为基础的算法计算最长的$k$ -过山车的长度。

英文摘要:

For $k\geq 3$, a k-rollercoaster is a sequence of numbers whose every maximal contiguous subsequence, that is increasing or decreasing, has length at least $k$; $3$-rollercoasters are called simply rollercoasters. Given a sequence of distinct numbers, we are interested in computing its maximum-length (not necessarily contiguous) subsequence that is a $k$-rollercoaster. Biedl et al. [ICALP 2018] have shown that each sequence of $n$ distinct real numbers contains a rollercoaster of length at least $\lceil n/2\rceil$ for $n>7$, and that a longest rollercoaster contained in such a sequence can be computed in $O(n\log n)$-time. They have also shown that every sequence of $n\geq (k-1)^2+1$ distinct real numbers contains a $k$-rollercoaster of length at least $\frac{n}{2(k-1)}-\frac{3k}{2}$, and gave an $O(nk\log n)$-time algorithm computing a longest $k$-rollercoaster in a sequence of length $n$. In this paper, we give an $O(nk^2)$-time algorithm computing the length of a longest $k$-rollercoaster contained in a sequence of $n$ distinct real numbers; hence, for constant $k$, our algorithm computes the length of a longest $k$-rollercoaster in optimal linear time. The algorithm can be easily adapted to output the respective $k$-rollercoaster. In particular, this improves the results of Biedl et al. [ICALP 2018], by showing that a longest rollercoaster can be computed in optimal linear time. We also present an algorithm computing the length of a longest $k$-rollercoaster in $O(n \log^2 n)$-time, that is, subquadratic even for large values of $k\leq n$. Again, the rollercoaster can be easily retrieved. Finally, we show an $Ω(n \log k)$ lower bound for the number of comparisons in any comparison-based algorithm computing the length of a longest $k$-rollercoaster.

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

↑