Solved

How to generate a next [] table in KMP algorithm using Java code

Posted on 2011-02-12
4
1,073 Views
Last Modified: 2012-05-11
Hi, The idea is to create an automatic data string table which will be used for string matching
0
Comment
Question by:vicbis
4 Comments
 
LVL 37

Accepted Solution

by:
TommySzalapski earned 250 total points
ID: 34879532
Are you talking about the preprocessing step as the "next [] table"? This describes the algorithm well and provides code in C/C++/Java.
http://www.inf.fh-flensburg.de/lang/algorithmen/pattern/kmpen.htm
It's a bit technical; but if you read it carefully, it makes sense.

If you need a more English explanation of anything, let us know.
If you are using some non-standard version of KMP, post a link to where it is described.
0
 
LVL 32

Assisted Solution

by:phoffric
phoffric earned 250 total points
ID: 34880395
You may be interested in reviewing this answered question: Calculating the "next" table in the KMP searching algorithm

If you learn better by watching course lectures, then review this Knuth-Morris-Pratt Algorithm video; just click on the 16:54 Knuth-Morris-Pratt Algorithm link. The following slides are used in this 10 minute video section.

KMP-1.PNG
KMP-2.PNG
KMP-3.PNG
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 35321677
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
format the code in java 6 86
Python Encoding Problem \u2013 4 107
word0 challenge 3 78
firstChar challenge 13 107
One of Google's most recent algorithm changes affecting local searches is entitled "The Pigeon Update." This update has dramatically enhanced search inquires for the keyword "Yelp." Google searches with the word "Yelp" included will now yield Yelp a…
Article by: Nadia
Linear search (searching each index in an array one by one) works almost everywhere but it is not optimal in many cases. Let's assume, we have a book which has 42949672960 pages. We also have a table of contents. Now we want to read the content on p…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now