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.
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
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.
M. Crochemore, D. Perrin, Two-way string-matching, J. ACM (1989). to appear.
M. Crochemore, String-Matching on Ordered Alphabets, Theoret. Comput. Sci. (1991). to appear.
Z. Galil, J. Seiferas, Saving space in fast string matching, SIAM J. Comput. 9 (1980) 417–438.
Z. Galil, J. Seiferas, Time-space optimal string matching, J. Comput. Syst. Sci. 26 (1983) 280–294.
A. Gibbons, W. Rytter, Efficient parallel algorithms, Cambridge University Press, Cambridge, 1988.
D.E. Knuth, J.H. Morris Jr, V.R. Pratt, Fast pattern matching in strings, SIAM J.Comput. 6 (1977) 323–350.
M. Lothake, Combinatorics on words, Addison-Wesley, Reading, Mass., 1983.
I. Simon, personal communication, 1989.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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