### Abstract

A new approach to time-space efficient string-matching is presented. The method is flexible, its implementation depends whether or not the alphabet is linearly ordered. The only known linear-time constant-space algorithm for string-matching over nonordered alphabets is the Galil-Seiferas algorithm, see Crochemore (1993) and Galil (1983) which are rather complicated. The zooming method gives probably the simplest string-matching algorithm working in constant space and linear time for nonordered alphabets. The novel feature of our algorithm is the application of the searching phase (which is usually simpler than preprocessing) in the preprocessing phase. The preprocessing has a recursive structure similar to selection in linear time, see Aho (1974). For ordered alphabets the preprocessing part is much simpler, its basic component is a simple and well-known algorithm for finding the maximal suffix, see Duval (1983). Hence we demonstrate a new application of this algorithm, see also Crochemore (1991). The idea of the zooming method was applied by Crochemore et al. (1995) to two-dimensional patterns.

Original language | English (US) |
---|---|

Pages (from-to) | 19-30 |

Number of pages | 12 |

Journal | Theoretical Computer Science |

Volume | 147 |

Issue number | 1-2 |

DOIs | |

State | Published - Aug 7 1995 |

Externally published | Yes |

### Fingerprint

### ASJC Scopus subject areas

- Theoretical Computer Science
- Computer Science(all)

### Cite this

*Theoretical Computer Science*,

*147*(1-2), 19-30. https://doi.org/10.1016/0304-3975(94)00249-I