Skip to main content

Online and Dynamic Recognition of Squarefree Strings

  • Conference paper
Mathematical Foundations of Computer Science 2005 (MFCS 2005)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 3618))

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Apostolico, A., Preparata, F.P.: Optimal off-line detection of repetitions in a string. Theoretical Computer Science 22(3), 297–315 (1983)

    Article  MATH  MathSciNet  Google Scholar 

  2. Bean, D.R., Ehrenfeucht, A., McNulty, G.F.: Avoidable patterns in strings of symbols. Pacific Journal of Mathematics 85(2), 261–294 (1979)

    MATH  MathSciNet  Google Scholar 

  3. Benson, G.: Tandem repeats finder: A program to analyze DNA sequences. Nucleic Acids Research 27(2), 573–580 (1999)

    Article  MathSciNet  Google Scholar 

  4. Breslauer, D.: Efficient String Algorithmics. PhD thesis, Columbia University (1992)

    Google Scholar 

  5. Castelo, A.T., Martins, W., Gao, G.R.: TROLL – tandem repeat occurrence locator. Bioinformatics 18(4), 634–636 (2002)

    Article  Google Scholar 

  6. 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)

    Google Scholar 

  7. Crochemore, M.: An optimal algorithm for computing the repetitions in a word. Information Processing Letters 12(5), 244–250 (1981)

    Article  MATH  MathSciNet  Google Scholar 

  8. Crochemore, M.: Transducers and repetitions. Theoretical Computer Science 45, 63–86 (1986)

    Article  MATH  MathSciNet  Google Scholar 

  9. Crochemore, M., Rytter, W.: Jewels of Stringology. World Scientific, Singapore (2002)

    Book  Google Scholar 

  10. Farach-Colton, M., Ferragina, P., Muthukrishnan, S.: On the sorting-complexity of suffix tree construction. Journal of the ACM 47(6), 987–1011 (2000)

    Article  MATH  MathSciNet  Google Scholar 

  11. Gusfield, D.: Algorithms on Strings, Trees, and Sequences. Cambridge University Press, Cambridge (1997)

    Book  MATH  Google Scholar 

  12. Karhumäki, J.: Automata on words. In: Ibarra, O.H., Dang, Z. (eds.) CIAA 2003. LNCS, vol. 2759, pp. 3–10. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  13. Kumar, V.: Algorithms for constraint satisfaction problems: A survey. AI Magazine 12(1), 32–44 (1992)

    Google Scholar 

  14. 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)

    Google Scholar 

  15. 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)

    Chapter  Google Scholar 

  16. Main, M.G., Bucher, W., Haussler, D.: Applications of an infinite square-free co-CFL. Theoretical Computer Science 49(2–3), 113–119 (1987)

    Article  MATH  MathSciNet  Google Scholar 

  17. 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)

    Article  MATH  MathSciNet  Google Scholar 

  18. 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)

    Google Scholar 

  19. 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)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics