Skip to content

Commit 6157053

Browse files
authored
Update BoyerMoore.java
1 parent ed75b53 commit 6157053

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/main/java/com/thealgorithms/searches/BoyerMoore.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
*/
88
public class BoyerMoore {
99

10-
private final int R;
11-
private int[] right;
12-
private String pattern;
10+
private final int R; // Radix
11+
private final int[] right; // Bad character rule table
12+
private final String pattern;
1313

1414
public BoyerMoore(String pat) {
1515
this.pattern = pat;
@@ -45,10 +45,11 @@ public int search(String text) {
4545
}
4646
}
4747
if (skip == 0) {
48-
return i;
48+
return i; // Match found
4949
}
5050
}
51-
return -1;
51+
52+
return -1; // No match
5253
}
5354

5455
public static int search(String text, String pattern) {

0 commit comments

Comments
 (0)