Longest Palindromic Substring in Sublinear Time
Résumé
We revisit the classic algorithmic problem of computing a longest palidromic substring. This problem is solvable by a celebrated O(n)-time algorithm [Manacher, J. ACM 1975], where n is the length of the input string. For small alphabets, O(n) is not necessarily optimal in the word RAM model of computation: a string of length n over alphabet [0, σ) can be stored in O(n log σ/ log n) space and read in O(n log σ/ log n) time. We devise a simple O(n log σ/ log n)-time algorithm for computing a longest palindromic substring. In particular, our algorithm works in sublinear time if σ = 2 o(log n). Our technique relies on periodicity and on the O(n log σ/ log n)-time constructible data structure of Kempa and Kociumaka [STOC 2019] that answers longest common extension queries in O(1) time.
Domaines
Informatique [cs]
Origine : Fichiers éditeurs autorisés sur une archive ouverte