Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2011-02-12
4
Medium Priority
?
1,281 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 1000 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 1000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Prime numbers are natural numbers greater than 1 that have only two divisors (the number itself and 1). By “divisible” we mean dividend % divisor = 0 (% indicates MODULAR. It gives the reminder of a division operation). We’ll follow multiple approac…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This video teaches viewers about errors in exception handling.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

927 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