arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1901.10722cs.DS
收藏

在单个字符或分块编辑后计算最长回文子串

Computing longest palindromic substring after single-character or block-wise edits

Mitsuru Funakoshi, Yuto Nakashima, Shunsuke Inenaga, Hideo Bannai, Masayuki Takeda

摘要:

回文是字符串中的重要对象,已经从组合、算法和生物信息学的角度进行了广泛的研究。已知长度为n的给定字符串T的最长回文子串(LPS)的长度可以通过Manacher算法在O(n)时间内计算[J. ACM '75]。在本文中,我们考虑的问题,找到LPS后,字符串被编辑。我们提出了一个O(n)时间和空间的预处理算法,并在O(\log(\min \{σ,\log n\}))时间内回答了单个字符替换、插入或删除后LPS的长度,其中σ表示T中出现的不同字符的数量.我们还提出了一个算法,使用O(n)的时间和空间进行预处理,并回答了O(\ell + \log \log n)时间的长度的LPS后,T中的现有子串被替换为任意长度的字符串\ell。

英文摘要:

Palindromes are important objects in strings which have been extensively studied from combinatorial, algorithmic, and bioinformatics points of views. It is known that the length of the longest palindromic substrings (LPSs) of a given string T of length n can be computed in O(n) time by Manacher's algorithm [J. ACM '75]. In this paper, we consider the problem of finding the LPS after the string is edited. We present an algorithm that uses O(n) time and space for preprocessing, and answers the length of the LPSs in O(\log (\min \{σ, \log n\})) time after a single character substitution, insertion, or deletion, where σdenotes the number of distinct characters appearing in T. We also propose an algorithm that uses O(n) time and space for preprocessing, and answers the length of the LPSs in O(\ell + \log \log n) time, after an existing substring in T is replaced by a string of arbitrary length \ell.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑