Skip to main content
Cornell University
We gratefully acknowledge support from the Simons Foundation, member institutions, and all contributors. Donate
arxiv logo > cs > arXiv:1810.07422

Help | Advanced Search

arXiv logo
Cornell University Logo

quick links

  • Login
  • Help Pages
  • About

Computer Science > Data Structures and Algorithms

arXiv:1810.07422 (cs)
[Submitted on 17 Oct 2018 (v1), last revised 7 Aug 2019 (this version, v2)]

Title:Fast and Longest Rollercoasters

Authors:Paweł Gawrychowski, Florin Manea, Radosław Serafin
View a PDF of the paper titled Fast and Longest Rollercoasters, by Pawe{\l} Gawrychowski and 2 other authors
View PDF
Abstract: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 $\Omega(n \log k)$ lower bound for the number of comparisons in any comparison-based algorithm computing the length of a longest $k$-rollercoaster.
Subjects: Data Structures and Algorithms (cs.DS)
ACM classes: F.2.2
Cite as: arXiv:1810.07422 [cs.DS]
  (or arXiv:1810.07422v2 [cs.DS] for this version)
  https://doi.org/10.48550/arXiv.1810.07422
arXiv-issued DOI via DataCite

Submission history

From: Florin Manea [view email]
[v1] Wed, 17 Oct 2018 08:12:01 UTC (115 KB)
[v2] Wed, 7 Aug 2019 14:13:28 UTC (115 KB)
Full-text links:

Access Paper:

    View a PDF of the paper titled Fast and Longest Rollercoasters, by Pawe{\l} Gawrychowski and 2 other authors
  • View PDF
  • TeX Source
  • Other Formats
license icon view license
Current browse context:
cs.DS
< prev   |   next >
new | recent | 2018-10
Change to browse by:
cs

References & Citations

  • NASA ADS
  • Google Scholar
  • Semantic Scholar

DBLP - CS Bibliography

listing | bibtex
Pawel Gawrychowski
Florin Manea
Radoslaw Serafin
export BibTeX citation Loading...

BibTeX formatted citation

×
Data provided by:

Bookmark

BibSonomy logo Reddit logo

Bibliographic and Citation Tools

Bibliographic Explorer (What is the Explorer?)
Connected Papers (What is Connected Papers?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)

Code, Data and Media Associated with this Article

alphaXiv (What is alphaXiv?)
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Hugging Face (What is Huggingface?)
Papers with Code (What is Papers with Code?)
ScienceCast (What is ScienceCast?)

Demos

Replicate (What is Replicate?)
Hugging Face Spaces (What is Spaces?)
TXYZ.AI (What is TXYZ.AI?)

Recommenders and Search Tools

Influence Flower (What are Influence Flowers?)
CORE Recommender (What is CORE?)
  • Author
  • Venue
  • Institution
  • Topic

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Which authors of this paper are endorsers? | Disable MathJax (What is MathJax?)
  • About
  • Help
  • contact arXivClick here to contact arXiv Contact
  • subscribe to arXiv mailingsClick here to subscribe Subscribe
  • Copyright
  • Privacy Policy
  • Web Accessibility Assistance
  • arXiv Operational Status
    Get status notifications via email or slack