Solved

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

Posted on 2011-02-12
4
1,063 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
substring method in java 1 79
WPF - External data binding to controls inside a UserControl 2 44
countX 22 70
countHi challenge 25 85
There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
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…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

746 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

15 Experts available now in Live!

Get 1:1 Help Now