Palindromes are strings that read the same forward and backward. The computation of palindromic structures within strings is a fundamental problem in string algorithms, being motivated by potential applications in formal language theory and bioinformatics. Although the number of palindromic factors in a string of length $n$ can be quadratic, they can be implicitly represented in $O(n \log n)$ bits of space by storing the lengths of all maximal palindromes in an integer array, which can be computed in $O(n)$ time [Manacher, 1975]. In this paper, we propose a novel $O(n)$-bit representation of all maximal palindromes in a string, which enables $O(1)$-time retrieval of the length of the maximal palindrome centered at any given position. The data structure can be constructed in $O(n)$ time from the input string of length $n$. Since Manacher's algorithm and the notion of maximal palindromes are widely utilized for solving numerous problems involving palindromic structures, our compact representation will accelerate the development of more space-efficient solutions to such problems. Indeed, as the first application of our compact representation of maximal palindromes, we present a data structure of size $O(n)$ bits that can compute the longest palindrome appearing in any given factor of a string of length $n$ in $O(\log n)$ time.


翻译:回文串是指正读反读都相同的字符串。计算字符串中的回文结构是字符串算法中的一个基本问题,其研究动机源于形式语言理论和生物信息学中的潜在应用。虽然长度为$n$的字符串中回文子串的数量可能达到二次方规模,但通过存储所有最大回文子串的长度至整数数组,可以将其隐式表示为$O(n \log n)$比特的空间复杂度,且该数组可在$O(n)$时间内计算完成[Manacher, 1975]。本文提出一种新颖的$O(n)$比特表示法,用于表示字符串中的所有最大回文子串,该结构支持在$O(1)$时间内检索任意给定中心位置的最大回文长度。该数据结构可在$O(n)$时间内从长度为$n$的输入字符串构建完成。由于Manacher算法和最大回文子串的概念被广泛应用于解决涉及回文结构的众多问题,我们提出的紧凑表示将推动此类问题更高效空间解决方案的发展。作为最大回文子串紧凑表示的首个应用,我们进一步提出一个$O(n)$比特大小的数据结构,该结构能够在$O(\log n)$时间内计算长度为$n$的字符串中任意给定子串内出现的最长回文。

0
下载
关闭预览

相关内容

几何关系嵌入
专知会员服务
28+阅读 · 2024年10月5日
【SIGIR2024】生成检索作即多向量密集检索
专知会员服务
23+阅读 · 2024年4月5日
【KDD2023】分布外图学习
专知会员服务
31+阅读 · 2023年8月17日
【WWW2021】知识图谱逻辑查询的自监督双曲面表示
专知会员服务
30+阅读 · 2021年4月9日
图节点嵌入(Node Embeddings)概述,9页pdf
专知
15+阅读 · 2020年8月22日
基于LDA的主题模型实践(一)
机器学习深度学习实战原创交流
20+阅读 · 2015年9月9日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
相关VIP内容
几何关系嵌入
专知会员服务
28+阅读 · 2024年10月5日
【SIGIR2024】生成检索作即多向量密集检索
专知会员服务
23+阅读 · 2024年4月5日
【KDD2023】分布外图学习
专知会员服务
31+阅读 · 2023年8月17日
【WWW2021】知识图谱逻辑查询的自监督双曲面表示
专知会员服务
30+阅读 · 2021年4月9日
相关资讯
图节点嵌入(Node Embeddings)概述,9页pdf
专知
15+阅读 · 2020年8月22日
基于LDA的主题模型实践(一)
机器学习深度学习实战原创交流
20+阅读 · 2015年9月9日
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员