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

Manacher算法的一种有效实现

An Efficient Implementation of Manacher's Algorithm

Shoupu Wan

摘要:

Manacher算法已被证明是最佳的最长回文子串问题。然而,该算法的许多现有实现都一致要求在内存中构造一个长度为原始字符串两倍的扩充字符串。虽然它已被广泛使用,但我们发现这种预处理既不经济也不必要。我们提出了一个更有效的实现Manacher的算法的基础上索引映射,使字符串扩增过程过时。

英文摘要:

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.

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

↑