arXiv · 2003.08211
An Efficient Implementation of Manacher's Algorithm
Abstract
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.
Explore related subjects
Keep this discovery
Shoupu Wan. 2020-03-17. An Efficient Implementation of Manacher's Algorithm. https://arxiv.org/abs/2003.08211
Cite the original work for its findings. Save a collection to share your selection of sources.