The Shift-add Approach to String Matching

Abstract

S t r i n g s e a r c h i n g is a v e r y i m p o r t a n t c o m p o n e n t o f m a n y p r o b l e m s , i n c l u d i n g t ex t e d i t i n g , b i b l i o g r a p h i c r e t r i eva l , a n d s y m b o l m a n i p u l a t i o n . R e c e n t s u r v e y s o f s t r i n g s e a r c h i n g c a n be f o u n d in [4, 18]. T h e s t r i n g m a t c h i n g p r o b l e m cons i s t s o f f i n d i n g all o c c u r r ences o f a p a t t e r n o f l e n g t h m in a t ex t o f l e n g t h n. We generalize the p r o b l e m a l l o w i n g d o n ' t care s y m b o l s , t he c o m p l e m e n t o f a s y m b o l , and any f in i t e class o f s y m b o l s . We solve th i s p r o b l e m fo r o n e o r m o r e p a t t e r n s , w i t h o r w i t h o u t m i s m a t c h e s . F o r sma l l patterns the w o r s t c a s e t i m e is linear i n t he size o f the t ex t (we say t h a t a p a t t e r n is sma l l i f m is b o u n d e d b y a c o n s t a n t ) .

8 Figures and Tables

Cite this paper

@inproceedings{Gonnet2000TheSA, title={The Shift-add Approach to String Matching}, author={Gaston H. Gonnet}, year={2000} }