原始Boyer

编程入门 行业动态 更新时间:2024-10-13 22:24:17
本文介绍了原始Boyer-Moore和Boyer-Moore-Horspool算法之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我无法理解Horspool在他的算法中所做的更改。如果您有Boyer–Moore–Horspool算法的任何链接,请告诉我。

I am not able to understand the changes which Horspool made in his algorithm. If you have any link of Boyer–Moore–Horspool algorithm then please do tell me.

推荐答案

以下是我的一些观察结果:

Here are my few observations:

BM:

Preprocessing complexity: Θ(m + σ) Worst Case : Θ(nm) If pattern exists Θ(n+m) If pattern doesn't exist" Best Case : Θ(n/m) Space: Θ(σ) Comparisions: Θ(3n) Preprocessing: Uses Good Suffix and Bad Character Shift. At every step, it slides the pattern by the max of the slides suggested by the two heuristics. So it uses best of the two heuristics at every step. Boyer Moore algorithm uses the "bad" text character itself to determine the shift distance. Probably the fastest non-indexed text-search algorithm known. Works better in natural text and larger text searches. A little difficult to implement. Mostly used.

BMH:

Preprocessing complexity : Θ(m + σ) Worst Case : Θ(nm) Best Case : Θ(n) Space : Θ(σ) Comparisons : Θ(1/σ) to Θ(2/σ+1) Preprocessing: Recommends to Use only Bad Character Shift. uses the rightmost character of the current text window to determine the shift distance. Efficient for small alphabets Easy to implement.

更多推荐

原始Boyer

本文发布于:2023-11-30 09:04:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1649454.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:原始   Boyer

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!