Fast Algorithms for the Shortest Unique Palindromic Substring Problem on Run-Length Encoded Strings
Fast Algorithms for the Shortest Unique Palindromic Substring Problem on Run-Length Encoded Strings
复制标题
游程编码字符串上最短唯一回文子串问题的快速算法
DOI:
10.1007/s00224-020-09980-x
复制
发表时间:
2020
影响因子:
0.5
通讯作者:
Takeda Masayuki
中科院分区:
文献类型:
--
作者:
Watanabe Kiichi;Nakashima Yuto;Inenaga Shunsuke;Bannai Hideo;Takeda Masayuki
For a stringS, a palindromic substringS[i..j] is said to be ashortest unique palindromic substring(SUPS) for an interval [s,t] inS, ifS[i..j] occurs exactly once inS, the interval [i,j] contains [s,t], and every palindromic substring containing [s,t] which is shorter thanS[i..j] occurs at least twice inS. In this paper, we study the problem of answeringSUPSqueries on run-length encoded strings. We show how to preprocess a given run-length encoded stringRLESof sizeminO(m) space andtime so that allSUPSsfor any subsequent query interval can be answered intime, whereαis the number of outputs, andis the number of distinct runs ofRLES. Additionaly, we consider a variant of the SUPS problem where a query interval is also given in a run-length encoded form. For this variant of the problem, we present two alternative algorithms with faster queries. The first one answers queries intime and can be built intime, and the second one answers queries intime and can be built intime. Both of these data structures requireO(m) space.