Solved

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

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
no14 challenge 14 66
scoresClump  challenge 31 137
Specific format 21 196
Support for Notepad++ (including downloading & installing a plugin) 5 115
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…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

808 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