Skip to main content

An Efficient Online Algorithm for Square Detection

  • Conference paper
Computing and Combinatorics (COCOON 2004)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 3106))

Included in the following conference series:

Abstract

A square is a string of characters that can be divided into two identical substrings. The problem of detecting squares in a string finds applications in many areas such as bioinformatics and data compression. In this paper, we give the first efficient online algorithm for the problem. Given any input string, our algorithm reports the first square in the string using O(nlog2 n) time where n is the position in the string where the square ends. This time complexity is only a factor of O(log n) larger than that of an optimal offline algorithm.

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 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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., Breslauer, D.: An optimal O(log log n)-time parallel algorithm for detecting squares in a string. SIAM Journal on Computing 25(6), 1318–1331 (1996)

    Article  MATH  MathSciNet  Google Scholar 

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

    Article  MATH  MathSciNet  Google Scholar 

  3. 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 

  4. Crochemore, M., Rytter, W., Crochemore, R.: Text Algorithms. Oxford University Press, Oxford (1994)

    MATH  Google Scholar 

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

    Book  MATH  Google Scholar 

  6. Lee, J.H.M., Leung, H.F., Won, H.W.: Extending genet for non-binary constraint satisfaction problems. In: Proceedings of the 7th International Conference on Tools with Artificial Intelligence, pp. 338–343 (1995)

    Google Scholar 

  7. 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 Join Conference on Artifical Intelligence, pp. 13–17 (1998)

    Google Scholar 

  8. Main, M.G., Lorentz, R.J.: An O(n log n) algorithm for finding all repetitions in a string. Journal of Algorithms 5, 422–432 (1984)

    Article  MATH  MathSciNet  Google Scholar 

  9. 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. F12, pp. 271–278. Springer, Heidelberg (1985)

    Google Scholar 

  10. Rabin, M.O.: Discovering repetitions in strings. Combinatorial Algorithms on Words, 279–288 (1985)

    Google Scholar 

  11. 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. 180–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

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Leung, HF., Peng, Z., Ting, HF. (2004). An Efficient Online Algorithm for Square Detection. In: Chwa, KY., Munro, J.I.J. (eds) Computing and Combinatorics. COCOON 2004. Lecture Notes in Computer Science, vol 3106. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-27798-9_46

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-27798-9_46

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-22856-1

  • Online ISBN: 978-3-540-27798-9

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics