# A New Linear-Time On-Line'' Algorithm for Finding the Smallest Initial Palindrome of a String

@article{Manacher1975ANL,
title={A New Linear-Time On-Line'' Algorithm for Finding the Smallest Initial Palindrome of a String},
author={Glenn K. Manacher},
journal={J. ACM},
year={1975},
volume={22},
pages={346-351}
}
Despite significant advances in linear-time scanning algorithms, particularly those based wholly or in par t on either Cook's linear-time simulation of two-way deterministic pushdown automata or Weiner's algorithm, the problem of recognizing the initial leftmost nonvoid palindrome of a string in time proportional to the length N of the palindrome, examining no symbols other than those in the palindrome, has remained open. The present algorithm solves this problem, assuming tha t addition of two…
139 Citations

## Figures from this paper

Finding all periods and initial palindromes of a string in parallel
• Computer Science
Algorithmica
• 2005
An optimalO(log logn)-time CRCW-PRAM algorithm for computing all period lengths of a string is presented and a lower bound is derived for finding initial palindromes by modifying a known lower bound for finding the period length of astring.
The derivation of on-line algorithms, with an application to finding palindromes
A theory for the derivation of on-line algorithms derived in the Bird-Meertens calculus for program transformations provides a concise functional notation for algorithms, and a few powerful theorems for proving equalities of functions.
Computing Maximal Palindromes and Distinct Palindromes in a Trie
• Mathematics, Computer Science
Stringology
• 2019
These are the first sub-quadratic time solutions to the problem of computing maximal palindromes and distinct palindrome of a given trie T (i.e. rooted edge-labeled tree) in O(N log h) time and O( N) space.
Fast Pattern Matching in Strings
• Computer Science
SIAM J. Comput.
• 1977
An algorithm is presented which finds all occurrences of one given string within another, in running time proportional to the sum of the lengths of the strings, showing that the set of concatenations of even palindromes, i.e., the language $\{\alpha \alpha ^R\}^*$, can be recognized in linear time.
Fast Algorithms for the Shortest Unique Palindromic Substring Problem on Run-Length Encoded Strings
• Computer Science
Theory of Computing Systems
• 2020
The problem of answering S U P S queries on run-length encoded strings is studied and a variant of the SUPS problem where a query interval is also given in a run- length encoded form is considered.
A Linear-Time On-Line Recognition Algorithm for Palstar''
• Computer Science
JACM
• 1978
A hneartime on-hne recogmtmn algorithm is presented for P~ ("palstar") on a random-access machine with addmon and umform cost criterion and a recognition algorithm for Pt 2 on a two-way deterministic pushdown automaton is presented.
Palindrome Recognition In The Streaming Model
• Mathematics, Computer Science
STACS
• 2014
A one-pass randomized algorithm that solves the Palindrome Problem, which has an additive error and uses square root of n space and two variants of the algorithm which solve related and practical problems.
Longest substring palindrome after edit
• Computer Science
CPM
• 2018
An algorithm is presented that uses O(n) time and space for preprocessing, and answers the length of the LSPals in O(l + log n) time, after an existing substring in T is replaced by a string of arbitrary length l.
Looking for All Palindromes in a String
A palindrome is a string of the form αα', where α and α' are also strings and reverse to each other. The problem of the paper is defined as follows: given a string S of length n, find all palindromes

## References

SHOWING 1-10 OF 13 REFERENCES
Fast Pattern Matching in Strings
• Computer Science
SIAM J. Comput.
• 1977
An algorithm is presented which finds all occurrences of one given string within another, in running time proportional to the sum of the lengths of the strings, showing that the set of concatenations of even palindromes, i.e., the language $\{\alpha \alpha ^R\}^*$, can be recognized in linear time.
Linear Pattern Matching Algorithms
A linear time algorithm for obtaining a compacted version of a bi-tree associated with a given string is presented and indicated how to solve several pattern matching problems, including some from [4] in linear time.
The Design and Analysis of Computer Algorithms
• Computer Science
• 1974
This text introduces the basic data structures and programming techniques often used in efficient algorithms, and covers use of lists, push-down stacks, queues, trees, and graphs.
Recognition of palindromes by multihead Turing machines
• Proc. of the Steklov Math. Inst., Aead. of Sciences of the USSR
• 1973
Fast pat tern matching in strings
• Tech . Rep . CS
• 1974
Linear pat tern matching algorithms. IEEE Symp. on Switching and A u t o m a t a Theory, Vol
• RECEIVED DECEMBER 1973; REVISED NOVEMBER
• 1973
String matching add other products. Project MAC Memo
• 1974