Algorithm For String Matching

Let's talk about algorithms!

Moderator: Board moderators

Post Reply
Rocky
Experienced poster
Posts: 124
Joined: Thu Oct 14, 2004 9:05 am

Algorithm For String Matching

Post by Rocky »

What Is The Effiecient Algorithm For String Matching Then KMP.
Help Please.......

THANK"S IN ADVANCE
ROCKY
sumankar
A great helper
Posts: 286
Joined: Tue Mar 25, 2003 8:36 am
Location: calcutta
Contact:

Post by sumankar »

Depends on what problem are you trying to solve!

Its hard to tell, as performance of two algorithms depends on a lot of factors specially in case of string matching.Why don't you go read up on what we have here http://www-igm.univ-mlv.fr/~lecroq/string/.Maybe, you will have a better idea and be able to judge yourself.

HTH
Suman.
nibbler
New poster
Posts: 22
Joined: Fri Jun 04, 2004 10:30 pm

Post by nibbler »

KMP is O(N+M), which is worst case optimal. Boyer-Moore variants also have O(N+M) worst case, but their best case can be down to O(M+N/M), which is much better. If you are searching for more then one pattern, use Aho-Corasick. Is there a particular problem that you are trying to solve?
Rocky
Experienced poster
Posts: 124
Joined: Thu Oct 14, 2004 9:05 am

Post by Rocky »

Thank's For Reply.
Actually I Want To Solve The Problem 10679 (I LOVE STRING)
I Think KMP Is Not Enough For That Problem.Is It?????

Thank's Again
Rocky.
sumankar
A great helper
Posts: 286
Joined: Tue Mar 25, 2003 8:36 am
Location: calcutta
Contact:

Post by sumankar »

http://online-judge.uva.es/board/viewto ... 2&start=15
Adrian's post should give you all the hint you want.
Rocky
Experienced poster
Posts: 124
Joined: Thu Oct 14, 2004 9:05 am

Thank's For Reply

Post by Rocky »

Thank'ssss...
Yes I Think It Will Help Me .

Thank's Again
Rocky
Post Reply

Return to “Algorithms”