File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Knuth-Morris-Pratt Algorithm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Knuth-Morris-Pratt Algorithm" Watch "Knuth-Morris-Pratt Algorithm" New topic

Knuth-Morris-Pratt Algorithm

kasun chathuranga

Joined: Apr 27, 2006
Posts: 22
Dear all,
I want to implement KMP alorothem in Java. but i can not understand how it works. though i went through google, still the situation is same. can anybody help me in this matter. my basic problem is how to create the shifting table (in most web sites, next[]). Or can somebody direct me to a simple tutorial on KMP algorithm?

Thank You!
Hari Srinivas
Ranch Hand

Joined: Mar 26, 2008
Posts: 46
Glad to help you... You can check out KMP here Link
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Textual descriptions and dynamic applet visualizations of many string serach algorithms -including KMP- can be found at Neat!
I agree. Here's the link:
subject: Knuth-Morris-Pratt Algorithm
It's not a secret anymore!