String Maching Algorithm

Let's talk about algorithms!

Moderator: Board moderators

Post Reply
kamrul
New poster
Posts: 9
Joined: Sat Aug 24, 2002 11:21 am
Location: Dhaka, Bangladesh

String Maching Algorithm

Post by kamrul »

Can anyone tell me which one is the Best String maching algorithm ??
Tahseen Mohammad
Learning poster
Posts: 54
Joined: Sun Oct 28, 2001 2:00 am
Location: Bangladesh

Post by Tahseen Mohammad »

Among the algorithm I know, KMP is the fastest.

I don't understand it completely but I think its not hard to code.
Look in Coreman's chapter on "String Matching".
Tahseen Mohammad
Learning poster
Posts: 54
Joined: Sun Oct 28, 2001 2:00 am
Location: Bangladesh

Post by Tahseen Mohammad »

I forgot about the Boyer-Moore algorithm. :)
Its the asymptotically the fastest. It uses some heuristic functions.
But KMP is best in the worst case.

Both of them are in the same chapter of Coremen. Choose what
best suits your need.
Post Reply

Return to “Algorithms”