Computation of squares in a string

Preliminary version
  • S. Rao Kosaraju
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 807)


We design a linear time algorithm for computing a square substring from each position of a given string over a finite alphabet. The algorithm exploits several subtle properties of suffix trees for strings.


Current Phase Step Algorithm Linear Time Algorithm Combinatorial Algorithm Suffix Tree 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    A. Apostolico and F. P. Preparata. Optimal off-line detection of repetitions in a string, Theoretical Computer Science, pages 297–315, 1983.Google Scholar
  2. [2]
    W. L. Chang and E. L. Lawler. Approximate string matching in sublinear expected time. Proc. of 31st IEEE FOCS, pages 116–124, 1990.Google Scholar
  3. [3]
    M. T. Chen and J. Seiferas. Efficient and elegant subword tree construction. In A. Apostolico and Z. Galil, editors, Combinatorial Algorithms on Words, pages 97–107. Springer-Verlag, 1985.Google Scholar
  4. [4]
    M. Crochemore. An optimal algorithm for computing the repetitions in a word, Inf. Processing Letters 12, pages 244–250, 1981.Google Scholar
  5. [5]
    M. Crochemore. Transducers and repetitions, Theoretical Computer Science, pages 63–86, 1986.Google Scholar
  6. [6]
    M. G. Main and R. J. Lorentz. An O(n log n) algorithm for finding all repetitions in a string, J. of Algorithms, pages 422–432, 1984.Google Scholar
  7. [7]
    M. G. Main and R. L. Lorentz. Linear time recognition of squarefree strings. In A. Apostolico and Z. Galil, editors, Combinatorial Algorithms on Words, pages 271–278, Springer-Verlag, 1985.Google Scholar
  8. [S]
    E. M. McCreight. A space-economical suffix tree construction algorithm. J. of ACM, pages 262–272, 1976.Google Scholar
  9. [9]
    M. O. Rabin. Discovering repetitions in strings. In A. Apostolico and Z. Galil. editors, Combinatorial Algorithms on Words, pages 279–288. Springer-Verlag, 1985.Google Scholar
  10. [10]
    J. Seiferas. Subword trees, Class Notes, February 1977.Google Scholar
  11. [11]
    A. O. Slisenko. Detection of periodicities and string-matching in real time. J. of Soviet Mathematics, pages 1316–1386. 1983.Google Scholar
  12. [12]
    P. Weiner. Linear pattern matching algorithms. Proc. of 14th IEEE Symp. on Switching & Automata Theory, pages 1–11, 1973.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1994

Authors and Affiliations

  • S. Rao Kosaraju
    • 1
  1. 1.Department of Computer ScienceThe Johns Hopkins UniversityBaltimore

Personalised recommendations