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

Help | Advanced Search

arXiv logo
Cornell University Logo

quick links

  • Login
  • Help Pages
  • About

Computer Science > Data Structures and Algorithms

arXiv:2106.01595 (cs)
[Submitted on 3 Jun 2021 (v1), last revised 14 Aug 2021 (this version, v2)]

Title:Position Heaps for Cartesian-tree Matching on Strings and Tries

Authors:Akio Nishimoto, Noriki Fujisato, Yuto Nakashima, Shunsuke Inenaga
View a PDF of the paper titled Position Heaps for Cartesian-tree Matching on Strings and Tries, by Akio Nishimoto and 3 other authors
View PDF
Abstract:The Cartesian-tree pattern matching is a recently introduced scheme of pattern matching that detects fragments in a sequential data stream which have a similar structure as a query pattern. Formally, Cartesian-tree pattern matching seeks all substrings $S'$ of the text string $S$ such that the Cartesian tree of $S'$ and that of a query pattern $P$ coincide. In this paper, we present a new indexing structure for this problem called the Cartesian-tree Position Heap (CPH). Let $n$ be the length of the input text string $S$, $m$ the length of a query pattern $P$, and $\sigma$ the alphabet size. We show that the CPH of $S$, denoted $\mathsf{CPH}(S)$, supports pattern matching queries in $O(m (\sigma + \log (\min\{h, m\})) + occ)$ time with $O(n)$ space, where $h$ is the height of the CPH and $occ$ is the number of pattern occurrences. We show how to build $\mathsf{CPH}(S)$ in $O(n \log \sigma)$ time with $O(n)$ working space. Further, we extend the problem to the case where the text is a labeled tree (i.e. a trie). Given a trie $T$ with $N$ nodes, we show that the CPH of $T$, denoted $\mathsf{CPH}(T)$, supports pattern matching queries on the trie in $O(m (\sigma^2 + \log (\min\{h, m\})) + occ)$ time with $O(N \sigma)$ space. We also show a construction algorithm for $\mathsf{CPH}(T)$ running in $O(N \sigma)$ time and $O(N \sigma)$ working space.
Subjects: Data Structures and Algorithms (cs.DS)
Cite as: arXiv:2106.01595 [cs.DS]
  (or arXiv:2106.01595v2 [cs.DS] for this version)
  https://doi.org/10.48550/arXiv.2106.01595
arXiv-issued DOI via DataCite

Submission history

From: Shunsuke Inenaga [view email]
[v1] Thu, 3 Jun 2021 04:53:23 UTC (1,310 KB)
[v2] Sat, 14 Aug 2021 09:10:08 UTC (1,310 KB)
Full-text links:

Access Paper:

    View a PDF of the paper titled Position Heaps for Cartesian-tree Matching on Strings and Tries, by Akio Nishimoto and 3 other authors
  • View PDF
  • TeX Source
  • Other Formats
license icon view license
Current browse context:
cs.DS
< prev   |   next >
new | recent | 2021-06
Change to browse by:
cs

References & Citations

  • NASA ADS
  • Google Scholar
  • Semantic Scholar

DBLP - CS Bibliography

listing | bibtex
Noriki Fujisato
Yuto Nakashima
Shunsuke Inenaga
a 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