String Matching---BF algorithm (brute force method)

Source: Internet
Author: User
Tags first string

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.