English

Double-Ended Palindromic Trees in Linear Time

Data Structures and Algorithms 2025-11-25 v3 Discrete Mathematics Information Retrieval

Abstract

The palindromic tree (a.k.a. eertree) is a data structure that provides access to all palindromic substrings of a string. In this paper, we propose a dynamic version of eertree, called double-ended eertree, which supports online operations on the stored string, including double-ended queue operations, counting distinct palindromic substrings, and finding the longest palindromic prefix/suffix. At the heart of our construction, we identify a new class of substring occurrences, called surfaces, that are palindromic substring occurrences that are neither prefixes nor suffixes of any other palindromic substring occurrences, which is of independent interest. Surfaces characterize the link structure of all palindromic substrings in the eertree, thereby allowing a linear-time implementation of double-ended eertrees through a linear-time maintenance of surfaces.

Keywords

Cite

@article{arxiv.2210.02292,
  title  = {Double-Ended Palindromic Trees in Linear Time},
  author = {Qisheng Wang and Ming Yang and Xinrui Zhu},
  journal= {arXiv preprint arXiv:2210.02292},
  year   = {2025}
}

Comments

Full version, 64 pages, 2 tables, 17 algorithms. Title changed, abstract improved, some proofs simplified, the persistent part removed for simplicity

R2 v1 2026-06-28T02:51:30.387Z