全部版块 我的主页
论坛 数据科学与人工智能 IT基础 C与C++编程
2373 16
2015-06-20
.

  • Data Structures and Algorithms Using C++
  • By: Ananda Rao Akepogu; Radhika Raju Palagiri

  • Publisher: Pearson India

  • Pub. Date: July 30, 2010

  • Print ISBN-13: 978-81-317-5567-9

  • Web ISBN-13: 978-93-325-1199-6

  • Pages in Print Edition: 576

  • Subscriber Rating: [0 Ratings]


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2015-6-20 13:57:08
Brute Force Pattern Matching Algorithm

Brute force pattern matching algorithm is a good and simple algorithm for pattern matching. This algorithm finds all the possible substrings over the given large string, and checks for the given pattern on all the possible substrings.

If the pattern is with length 5, then the first substring from the text will be from the first character to the 5th character. The first substring will be cross checked with the pattern. If the substring and the pattern match, then the brute force algorithm returns with TRUE. If the substring and the pattern do not match, then the second substring will be from second character of the text to the 6th character of the text. The second substring will be cross checked with the pattern, if matches return TRUE or else the same process will be continued until the start index of the substring reaches n-length(P).

复制代码
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-6-20 13:58:50
The Boyer-Moore Algorithm

The Brute Force Algorithm finds all the possible substrings that can be matched with the search pattern, and searches all the characters of the given text. The Boyer-Moore (B-M) Algorithm is a faster algorithm when the search string is large. It is one of the best suitable algorithms for searching the words in the text document. Unlike the Brute Force algorithm, the Boyer-Moore Algorithm skips the unnecessary checks.

The B-M Algorithm works with a ‘backward’ approach, the target string is aligned with the start of the check string, and the last character of the target string is checked against the corresponding character in the check string. In the case of a match, then the second-to-last character of the target string is compared to the corresponding check string character. In the case of a mismatch, the algorithm computes a new alignment for the target string based on the mismatch. In the case of mismatch the algorithms skip checking some of the characters.

Boyer-Moore Algorithm steps: Character comparison is done from right of the pattern to the left:

  • Constructing the SHIFT Table
  • GOOD SUFFIX SHIFT or BAD CHARACTER SHIFT
复制代码


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-6-20 14:01:24
复制代码

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-6-20 14:02:44
复制代码

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-6-20 14:03:50
复制代码

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群