TY - JOUR
T1 - Palindromic trees for a sliding window and its applications
AU - Mieno, Takuya
AU - Watanabe, Kiichi
AU - Nakashima, Yuto
AU - Inenaga, Shunsuke
AU - Bannai, Hideo
AU - Takeda, Masayuki
N1 - Funding Information:
We would like to thank the anonymous referees for their helpful comments on an earlier version of this paper. This work was supported by JSPS KAKENHI Grant Numbers JP20J11983 (TM), JP18K18002 (YN), JP17H01697 (SI), JP20H04141 (HB), JP18H04098 (MT), and by JST PRESTO Grant Number JPMJPR1922 (SI).
Publisher Copyright:
© 2021 The Author(s)
PY - 2022/1
Y1 - 2022/1
N2 - The palindromic tree (a.k.a. eertree) for a string S of length n is a tree-like data structure that represents the set of all distinct palindromic substrings of S, using O(n) space [Rubinchik and Shur, 2018]. It is known that, when S is over an alphabet of size σ and is given in an online manner, then the palindromic tree of S can be constructed in O(nlogσ) time with O(n) space. In this paper, we consider the sliding window version of the problem: For a sliding window of length at most d, we present two versions of an algorithm which maintains the palindromic tree of size O(d) for every sliding window S[i..j] over S, where 1≤j−i+1≤d. The first version works in O(nlogσ′) time with O(d) space where σ′≤d is the maximum number of distinct characters in the windows, and the second one works in O(n+dσ) time with (d+2)σ+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.
AB - The palindromic tree (a.k.a. eertree) for a string S of length n is a tree-like data structure that represents the set of all distinct palindromic substrings of S, using O(n) space [Rubinchik and Shur, 2018]. It is known that, when S is over an alphabet of size σ and is given in an online manner, then the palindromic tree of S can be constructed in O(nlogσ) time with O(n) space. In this paper, we consider the sliding window version of the problem: For a sliding window of length at most d, we present two versions of an algorithm which maintains the palindromic tree of size O(d) for every sliding window S[i..j] over S, where 1≤j−i+1≤d. The first version works in O(nlogσ′) time with O(d) space where σ′≤d is the maximum number of distinct characters in the windows, and the second one works in O(n+dσ) time with (d+2)σ+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.
UR - http://www.scopus.com/inward/record.url?scp=85112466962&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85112466962&partnerID=8YFLogxK
U2 - 10.1016/j.ipl.2021.106174
DO - 10.1016/j.ipl.2021.106174
M3 - Article
AN - SCOPUS:85112466962
VL - 173
JO - Information Processing Letters
JF - Information Processing Letters
SN - 0020-0190
M1 - 106174
ER -