English

An Efficient Implementation of Manacher's Algorithm

Data Structures and Algorithms 2020-03-20 v2

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.

Keywords

Cite

@article{arxiv.2003.08211,
  title  = {An Efficient Implementation of Manacher's Algorithm},
  author = {Shoupu Wan},
  journal= {arXiv preprint arXiv:2003.08211},
  year   = {2020}
}
R2 v1 2026-06-23T14:18:38.446Z