Abstract
The online squarefree recognition problem is to detect the first occurrence of a square in a string whose characters are provided as input one at a time. We present an efficient algorithm to solve this problem for strings over arbitrarily ordered alphabets. Its running time is O(n log n), where n is the ending position of the first square, which matches the running times of the fastest known algorithms for the analogous offline problem. We also present a very simple algorithm for a dynamic version of the problem over general alphabets in which we are initially given a squarefree string, followed by a series of updates, and the objective is to determine after each update if the resulting string contains a square and if so, report it and stop.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Apostolico, A., Preparata, F.P.: Optimal off-line detection of repetitions in a string. Theoretical Computer Science 22(3), 297–315 (1983)
Bean, D.R., Ehrenfeucht, A., McNulty, G.F.: Avoidable patterns in strings of symbols. Pacific Journal of Mathematics 85(2), 261–294 (1979)
Benson, G.: Tandem repeats finder: A program to analyze DNA sequences. Nucleic Acids Research 27(2), 573–580 (1999)
Breslauer, D.: Efficient String Algorithmics. PhD thesis, Columbia University (1992)
Castelo, A.T., Martins, W., Gao, G.R.: TROLL – tandem repeat occurrence locator. Bioinformatics 18(4), 634–636 (2002)
Choffrut, C., Karhumäki, J.: Combinatorics of words. In: Salomaa, A., Rozenberg, G. (eds.) Handbook of Formal Languages, vol. 1, pp. 329–438. Springer, Heidelberg (1997)
Crochemore, M.: An optimal algorithm for computing the repetitions in a word. Information Processing Letters 12(5), 244–250 (1981)
Crochemore, M.: Transducers and repetitions. Theoretical Computer Science 45, 63–86 (1986)
Crochemore, M., Rytter, W.: Jewels of Stringology. World Scientific, Singapore (2002)
Farach-Colton, M., Ferragina, P., Muthukrishnan, S.: On the sorting-complexity of suffix tree construction. Journal of the ACM 47(6), 987–1011 (2000)
Gusfield, D.: Algorithms on Strings, Trees, and Sequences. Cambridge University Press, Cambridge (1997)
Karhumäki, J.: Automata on words. In: Ibarra, O.H., Dang, Z. (eds.) CIAA 2003. LNCS, vol. 2759, pp. 3–10. Springer, Heidelberg (2003)
Kumar, V.: Algorithms for constraint satisfaction problems: A survey. AI Magazine 12(1), 32–44 (1992)
Lee, J.H.M., Leung, H.-F., Won, H.W.: Performance of a comprehensive and efficient constraint library based on local search. In: Proceedings of the 11th Australian Joint Conference on Artificial Intelligence, pp. 191–202 (1998)
Leung, H.-F., Peng, Z., Ting, H.-F.: An efficient online algorithm for square detection. In: Chwa, K.-Y., Munro, J.I.J. (eds.) COCOON 2004. LNCS, vol. 3106, pp. 432–439. Springer, Heidelberg (2004)
Main, M.G., Bucher, W., Haussler, D.: Applications of an infinite square-free co-CFL. Theoretical Computer Science 49(2–3), 113–119 (1987)
Main, M.G., Lorentz, R.J.: An O(n logn) algorithm for finding all repetitions in a string. Journal of Algorithms 5(3), 422–432 (1984)
Main, M.G., Lorentz, R.J.: Linear time recognition of squarefree strings. In: Apostolico, A., Galil, Z. (eds.) Combinatorial Algorithms on Words. NATO ASI Series, vol. F 12, pp. 271–278. Springer, Heidelberg (1985)
Wong, J.H.Y., Leung, H.-F.: Solving fuzzy constraint satisfaction problems with fuzzy GENET. In: Proceedings of the 10th IEEE International Conference on Tools with Artificial Intelligence, pp. 184–191 (1998)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Jansson, J., Peng, Z. (2005). Online and Dynamic Recognition of Squarefree Strings. In: JÈ©drzejowicz, J., Szepietowski, A. (eds) Mathematical Foundations of Computer Science 2005. MFCS 2005. Lecture Notes in Computer Science, vol 3618. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11549345_45
Download citation
DOI: https://doi.org/10.1007/11549345_45
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-28702-5
Online ISBN: 978-3-540-31867-5
eBook Packages: Computer ScienceComputer Science (R0)