Computing the Maximal-Exponent Repeats of an Overlap-Free String in Linear Time
The exponent of a string is the quotient of the string’s length over the string’s smallest period. The exponent and the period of a string can be computed in time proportional to the string’s length. We design an algorithm to compute the maximal exponent of factors of an overlap-free string. Our algorithm runs in linear-time on a fixed-size alphabet, while a naive solution of the question would run in cubic time. The solution for non overlap-free strings derives from algorithms to compute all maximal repetitions, also called runs, occurring in the string. We show there is a linear number of maximal-exponent repeats in an overlap-free string. The algorithm can locate all of them in linear time.
KeywordsLinear Time String Length Maximal Repetition Input String Alphabet Size
Unable to display preview. Download preview PDF.
- 1.Bell, T.C., Cleary, J.G., Witten, I.H.: Text compression. Prentice-Hall, Englewood Cliffs (1990)Google Scholar
- 6.Crochemore, M., Hancart, C., Lecroq, T.: Algorithms on Strings, 392 pages. Cambridge University Press (2007)Google Scholar
- 18.Thue, A.: Über unendliche Zeichenreihen. Norske Vid. Selsk. Skr. I Math-Nat. Kl. 7, 1–22 (1906)Google Scholar
- 19.Ziv, J., Lempel, A.: A universal algorithm for sequential data compression 23, 337–343 (1977)Google Scholar