Finish writing the first string match article. Find out what is not actually introduced is the string matching algorithm. What is KMP, directly on the KMP next array is a bit abrupt. And when I'm going to write the second one, I find out why we have the KMP algorithm, where is it better than the normal algorithm? Look back and think about the common law of violence that should be written, so that the ability to clear their good. At the same time. Do not think it is a violent law to feel it is bad, you do not need to master it. Classmates. Do you know? Nearly all of the functions in the standard library that resemble string matching (for example: Java-indexof) are used by the BF (Brute force) method we will be using today for reasons
noredirect=1#comment35393536_23146845 ">stackoverflow.
OK, the following first formally put the issue out, given two strings s= "S0, S1, S2, ...., SN", t= "t0, T1, T2,..., TN", the process of finding a string T in the main string s is called a strings matching problem. T is called a pattern string.
BF (Brute force) algorithm. Should be very easy to write out, the following first give the pseudo code:
One, pseudo code
<>
String Matching---BF algorithm (brute force method)