We consider the problems of computing maximal palindromes and distinct palindromes in a trie. A trie is a natural generalization of a string, which can be seen as a single-path tree. There is a linear-time offline algorithm to compute maximal palindromes and distinct palindromes in a given (static) trie whose edge-labels are drawn from a linearly-sortable alphabet [Mieno et al., ISAAC 2022]. In this paper, we tackle problems of palindrome enumeration on dynamic tries which support leaf additions and leaf deletions. We propose the first sub-quadratic algorithms to enumerate palindromes in a dynamic trie. For maximal palindromes, we propose an algorithm that runs in $O(N \min(\log h, σ))$ time and uses $O(N)$ space, where $N$ is the maximum number of edges in the trie, $σ$ is the size of the alphabet, and $h$ is the height of the trie. For distinct palindromes, we develop several online algorithms based on different algorithmic frameworks, including approaches using the EERTREE (a.k.a. palindromic tree) and the suffix tree of a trie. These algorithms support leaf insertions and deletions in the trie and achieve different time and space trade-offs. Furthermore, as a by-product, we present online algorithms to construct the suffix tree and the EERTREE of the input trie, which is of independent interest.


翻译:本文研究在Trie(字典树)中计算最大回文串与不同回文串的问题。Trie是字符串的自然推广,可视为单路径树的扩展。对于边标签来自线性可排序字母表的给定(静态)Trie,存在线性时间离线算法可计算其最大回文串与不同回文串[Mieno等,ISAAC 2022]。本文致力于在支持叶子节点动态增删的Trie上进行回文串枚举。我们提出了首个亚二次时间算法以枚举动态Trie中的回文串。针对最大回文串,我们提出一种时间复杂度为$O(N \min(\log h, σ))$、空间复杂度为$O(N)$的算法,其中$N$为Trie中边的最大数量,$σ$为字母表大小,$h$为Trie高度。针对不同回文串,我们基于多种算法框架开发了若干在线算法,包括采用EERTREE(亦称回文树)和Trie后缀树的方法。这些算法支持Trie中叶子节点的插入与删除,并实现了不同的时空权衡。此外,作为副产品,我们提出了构建输入Trie的后缀树与EERTREE的在线算法,该成果具有独立的研究价值。

0
下载
关闭预览

相关内容

在数学和计算机科学之中,算法(Algorithm)为一个计算的具体步骤,常用于计算、数据处理和自动推理。精确而言,算法是一个表示为有限长列表的有效方法。算法应包含清晰定义的指令用于计算函数。 来自维基百科: 算法
专知会员服务
19+阅读 · 2021年5月16日
手把手 | 基于TextRank算法的文本摘要(附Python代码)
大数据文摘
11+阅读 · 2018年12月27日
论文浅尝 | 基于Universal Schema与Memory Network的知识+文本问答
论文浅尝 | 利用 RNN 和 CNN 构建基于 FreeBase 的问答系统
开放知识图谱
11+阅读 · 2018年4月25日
网络表示学习领域(NRL/NE)必读论文汇总
AI科技评论
16+阅读 · 2018年2月18日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 1月21日
VIP会员
相关VIP内容
专知会员服务
19+阅读 · 2021年5月16日
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员