We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c7f01c4 + 1d7425b commit 932f5fbCopy full SHA for 932f5fb
Contents/06.String/02.String-Single-Pattern-Matching/01.String-Brute-Force.md
@@ -43,7 +43,7 @@ BF 算法非常简单,容易理解,但其效率很低。主要是因为在
43
44
在最理想的情况下(第一次匹配直接匹配成功),BF 算法的最佳时间复杂度是 $O(m)$。
45
46
-在一般情况下,根据等概率原则,平均搜索次数为 $\frac{(n + m)}{2}$,所以 Brute Force 算法的平均时间复杂度为 $O(n + m)$。
+在一般情况下,根据等概率原则,平均搜索次数为 $\frac{(n + m)}{2}$,所以 Brute Force 算法的平均时间复杂度为 $O(n \times m)$。
47
48
## 参考资料
49
0 commit comments