English

Palindromic Trees for a Sliding Window and Its Applications

Data Structures and Algorithms 2020-11-12 v2

Abstract

The palindromic tree (a.k.a. eertree) for a string SS of length nn is a tree-like data structure that represents the set of all distinct palindromic substrings of SS, using O(n)O(n) space [Rubinchik and Shur, 2018]. It is known that, when SS is over an alphabet of size σ\sigma and is given in an online manner, then the palindromic tree of SS can be constructed in O(nlogσ)O(n\log\sigma) time with O(n)O(n) space. In this paper, we consider the sliding window version of the problem: For a sliding window of length at most dd, we present two versions of an algorithm which maintains the palindromic tree of size O(d)O(d) for every sliding window S[i..j]S[i..j] over SS, where 1ji+1d1 \leq j-i+1 \leq d. The first version works in O(nlogσ)O(n\log\sigma') time with O(d)O(d) space where σd\sigma' \leq d is the maximum number of distinct characters in the windows, and the second one works in O(n+dσ)O(n + d\sigma) time with (d+2)σ+O(d)(d+2)\sigma + O(d) space. We also show how our algorithms can be applied to efficient computation of minimal unique palindromic substrings (MUPS) and minimal absent palindromic words (MAPW) for a sliding window.

Keywords

Cite

@article{arxiv.2006.02134,
  title  = {Palindromic Trees for a Sliding Window and Its Applications},
  author = {Takuya Mieno and Kiichi Watanabe and Yuto Nakashima and Shunsuke Inenaga and Hideo Bannai and Masayuki Takeda},
  journal= {arXiv preprint arXiv:2006.02134},
  year   = {2020}
}
R2 v1 2026-06-23T16:01:15.402Z