Skip to main content

Periodic Prefixes in Texts

  • Conference paper
Sequences II

Abstract

We give some new results on the combinatorics of periodic prefixes in texts. This is related to the time-space optimal string-searching algorithm of Galil and Seiferas (called GS algorithm [GS 83]). The algorithm contains a parameter k that says how many times some prefixes repeat at the beginning of the text. The complexity of GS algorithm essentially depends on k and originally the GS algorithm works only for k≥4. We improve on the value of k and we show that k=3 is the least integer for which GS algorithm works. This value of the parameter k also minimizes the time of the search phase of the string-searching algorithm. With parameter k=2 we consider a simpler version of the algorithm working in linear time and logarithmic space. This algorithm is based on the following fact: any word of length n starts by less than logon squares of primitive prefixes. Fibonacci words have a logarithmic number of square prefixes. Hence the combinatorics of square prefixes and cube prefixes is essential for string-matching with small memory. We give a time-space optimal sequential computation of the period of a word based on GS algorithm. The latter corrects the algorithm given in [GS 83] for the computation of periods. We also present an optimal parallel algorithm for the pattern preprocessing.

Work by this author is supported by PRC “Mathématiques-Informatique” & NATO Grant CRG 900293.

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. A.V. Aho, Algorithms for finding patterns in strings, in: (J. Van Leeuwen, editor, Handbook of Theoretical Computer Science, vol A, Algorithms and complexity, Elsevier, Amsterdam, 1990) 255–300.

    Google Scholar 

  2. M. Crochemore, D. Perrin, Two-way string-matching, J. ACM (1989). to appear.

    Google Scholar 

  3. M. Crochemore, String-Matching on Ordered Alphabets, Theoret. Comput. Sci. (1991). to appear.

    Google Scholar 

  4. Z. Galil, J. Seiferas, Saving space in fast string matching, SIAM J. Comput. 9 (1980) 417–438.

    Article  MathSciNet  MATH  Google Scholar 

  5. Z. Galil, J. Seiferas, Time-space optimal string matching, J. Comput. Syst. Sci. 26 (1983) 280–294.

    Article  MathSciNet  Google Scholar 

  6. A. Gibbons, W. Rytter, Efficient parallel algorithms, Cambridge University Press, Cambridge, 1988.

    MATH  Google Scholar 

  7. D.E. Knuth, J.H. Morris Jr, V.R. Pratt, Fast pattern matching in strings, SIAM J.Comput. 6 (1977) 323–350.

    Article  MathSciNet  MATH  Google Scholar 

  8. M. Lothake, Combinatorics on words, Addison-Wesley, Reading, Mass., 1983.

    Google Scholar 

  9. I. Simon, personal communication, 1989.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1993 Springer-Verlag New York, Inc.

About this paper

Cite this paper

Crochemore, M., Rytter, W. (1993). Periodic Prefixes in Texts. In: Capocelli, R., De Santis, A., Vaccaro, U. (eds) Sequences II. Springer, New York, NY. https://doi.org/10.1007/978-1-4613-9323-8_12

Download citation

  • DOI: https://doi.org/10.1007/978-1-4613-9323-8_12

  • Publisher Name: Springer, New York, NY

  • Print ISBN: 978-1-4613-9325-2

  • Online ISBN: 978-1-4613-9323-8

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics