当前位置: X-MOL 学术arXiv.cs.DS › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
An Efficient Implementation of Manacher's Algorithm
arXiv - CS - Data Structures and Algorithms Pub Date : 2020-03-17 , DOI: arxiv-2003.08211
Shoupu Wan

Manacher's algorithm has been shown to be optimal to the longest palindromic substring problem. Many of the existing implementations of this algorithm, however, unanimously required in-memory construction of an augmented string that is twice as long as the original string. Although it has found widespread use, we found that this preprocessing is neither economic nor necessary. We present a more efficient implementation of Manacher's algorithm based on index mapping that makes the string augmentation process obsolete.

中文翻译:

Manacher算法的有效实现

Manacher 算法已被证明对最长回文子串问题是最优的。然而,该算法的许多现有实现都一致要求在内存中构造一个长度是原始字符串两倍的增强字符串。尽管它已被广泛使用,但我们发现这种预处理既不经济也不必要。我们提出了一种基于索引映射的 Manacher 算法的更有效实现,该算法使字符串增强过程过时。
更新日期:2020-03-20
down
wechat
bug