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.
1 parent ed75b53 commit 6157053Copy full SHA for 6157053
src/main/java/com/thealgorithms/searches/BoyerMoore.java
@@ -7,9 +7,9 @@
7
*/
8
public class BoyerMoore {
9
10
- private final int R;
11
- private int[] right;
12
- private String pattern;
+ private final int R; // Radix
+ private final int[] right; // Bad character rule table
+ private final String pattern;
13
14
public BoyerMoore(String pat) {
15
this.pattern = pat;
@@ -45,10 +45,11 @@ public int search(String text) {
45
}
46
47
if (skip == 0) {
48
- return i;
+ return i; // Match found
49
50
51
- return -1;
+
52
+ return -1; // No match
53
54
55
public static int search(String text, String pattern) {
0 commit comments