This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 41123
Textual descriptions and dynamic applet visualizations of many string serach algorithms -including KMP- can be found at Neat!

Ping & DNS - my free Android networking tools app
I agree. Here's the link:
subject: Knuth-Morris-Pratt Algorithm
Similar Threads
pattern search
How to identify the changes in a file?
Extract/Read Data from a file between a particualar time frame
Doubt regarding indexof or regex
longest repeated substring - overlaping allowed