Computing Palindromes on a Trie in Linear Time

Takuya Mieno, Mitsuru Funakoshi, Shunsuke Inenaga

Research output: Chapter in Book/Report/Conference proceedingConference contribution

1 Citation (Scopus)

Abstract

A trie T is a rooted tree such that each edge is labeled by a single character from the alphabet, and the labels of out-going edges from the same node are mutually distinct. Given a trie T with n edges, we show how to compute all distinct palindromes and all maximal palindromes on T in O(n) time, in the case of integer alphabets of size polynomial in n. This improves the state-of-the-art O(n log h)-time algorithms by Funakoshi et al. [PSC 2019], where h is the height of T . Using our new algorithms, the eertree with suffix links for a given trie T can readily be obtained in O(n) time. Further, our trie-based O(n)-space data structure allows us to report all distinct palindromes and maximal palindromes in a query string represented in the trie T , in output optimal time. This is an improvement over an existing (naïve) solution that precomputes and stores all distinct palindromes and maximal palindromes for each and every string in the trie T separately, using a total O(n2) preprocessing time and space, and reports them in output optimal time upon query.

Original languageEnglish
Title of host publication33rd International Symposium on Algorithms and Computation, ISAAC 2022
EditorsSang Won Bae, Heejin Park
PublisherSchloss Dagstuhl- Leibniz-Zentrum fur Informatik GmbH, Dagstuhl Publishing
ISBN (Electronic)9783959772587
DOIs
Publication statusPublished - Dec 1 2022
Externally publishedYes
Event33rd International Symposium on Algorithms and Computation, ISAAC 2022 - Virtual, Online, Korea, Republic of
Duration: Dec 19 2022Dec 21 2022

Publication series

NameLeibniz International Proceedings in Informatics, LIPIcs
Volume248
ISSN (Print)1868-8969

Conference

Conference33rd International Symposium on Algorithms and Computation, ISAAC 2022
Country/TerritoryKorea, Republic of
CityVirtual, Online
Period12/19/2212/21/22

All Science Journal Classification (ASJC) codes

  • Software

Fingerprint

Dive into the research topics of 'Computing Palindromes on a Trie in Linear Time'. Together they form a unique fingerprint.

Cite this