We exhibit an online algorithm finding all distinct palindromes inside a given string in time Θ(n log |Σ|) over an ordered alphabet and in time Θ(n|Σ|) over an unordered alphabet. Using a reduction from a dictionary-like data structure, we prove the optimality of this algorithm in the comparison-based computation model.
We prove that a random word of length n over a k-ary fixed alphabet contains, on expectation , Θ(√ n) distinct palindromic factors. We study this number of factors, E(n, k), in detail, showing that the limit lim n→∞ E(n, k)/ √ n does not exist for any k ≥ 2, lim inf n→∞ E(n, k)/ √ n = Θ(1), and lim sup n→∞ E(n, k)/ √ n = Θ(√ k). Such a complicated behaviour… (More)
We propose a new linear-size data structure which provides a fast access to all palindromic substrings of a string or a set of strings. This structure inherits some ideas from the construction of both the suffix trie and suffix tree. Using this structure, we present simple and efficient solutions for a number of problems involving palindromes.
Given a language L that is online recognizable in linear time and space, we construct a linear time and space online recognition algorithm for the language L · Pal, where Pal is the language of all nonempty palindromes. Hence for every fixed positive k, Pal k is online recognizable in linear time and space. Thus we solve an open problem posed by Galil and… (More)