SQUARES, CUBES, AND TIME-SPACE EFFICIENT STRING SEARCHING

被引:92
作者
CROCHEMORE, M [1 ]
RYTTER, W [1 ]
机构
[1] WARSAW UNIV,INST INFORMAT,PL-00913 WARSAW 59,POLAND
关键词
ANALYSIS OF ALGORITHMS; ALGORITHMS ON STRINGS; PATTERN MATCHING; STRING MATCHING; PERIODS OF WORDS; PARALLEL ALGORITHMS;
D O I
10.1007/BF01190846
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We address several technical problems related to the time-space optimal string-matching algorithm of Galil and Seiferas (called the GS algorithm). This algorithm contains a parameter k on which the complexity depends and that orginally satisifies k greater-than-or-equal-to 4. We show that k = 3 is the least integer for which the GS algorithm works. This value of the parameter k also minimizes the time of the search phase of the string-searching algorithm. With the 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 log(THETA) n squares of primitive prefixes. Fibonacci words have a logarithmic number of square prefixes. Hence, the combinatorics of prefix squares and cubes is essential for string-matching with small memory. We give a time-space optimal sequential computation of the period of a word based on the GS algorithm. The latter corrects the algorithm given in [GS2] for the computation of periods. We present an optimal parallel algorithm for pattern preprocessing. This paper also provides a cleaner version and a simpler analysis of the GS algorithm.
引用
收藏
页码:405 / 425
页数:21
相关论文
共 10 条
[1]  
AHO AV, 1990, HDB THEORETICAL COMP, VA, P255
[2]   STRING-MATCHING ON ORDERED ALPHABETS [J].
CROCHEMORE, M .
THEORETICAL COMPUTER SCIENCE, 1992, 92 (01) :33-47
[3]  
CROCHEMORE M, 1991, J ACM, V38, P651, DOI 10.1145/116825.116845
[4]   TIME-SPACE-OPTIMAL STRING MATCHING [J].
GALIL, Z ;
SEIFERAS, J .
JOURNAL OF COMPUTER AND SYSTEM SCIENCES, 1983, 26 (03) :280-294
[5]   SAVING SPACE IN FAST STRING-MATCHING [J].
GALIL, Z ;
SEIFERAS, J .
SIAM JOURNAL ON COMPUTING, 1980, 9 (02) :417-438
[6]  
GIBBONS A, 1988, EFFICIENT PARALLEL A
[7]  
Knuth D. E., 1977, SIAM Journal on Computing, V6, P323, DOI 10.1137/0206024
[8]  
Lothaire M., 1983, COMBINATORICS WORDS
[9]  
SIMON I, 1989, COMMUNICATION
[10]   OPTIMAL PARALLEL PATTERN-MATCHING IN STRINGS [J].
VISHKIN, U .
INFORMATION AND CONTROL, 1985, 67 (1-3) :91-113