Skip to content

Commit 9181bde

Browse files
BoyerMoore.js| Final fix indentation.
1 parent 40bd41c commit 9181bde

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

String/BoyerMoore.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
/*
22
*
33
*
4-
*Implementation of the Boyer-Moore String Search Algo.
4+
*Implementation of the Boyer-Moore String Search Algorithm.
55
*The Boyer–Moore string search algorithm allows linear time in
6-
* search by skipping
7-
* indices when searching inside a string for a pattern.
6+
*search by skipping indices when searching inside a string for a pattern.
87
*
98
*
109
*
@@ -39,10 +38,10 @@ const boyerMoore = (str, pattern) => {
3938
}
4039
const badMatchString = str[offset + patternLastIndex]
4140
if (badMatchTable[badMatchString]) {
42-
// increase the offset if it exists
41+
// increase the offset if it exists
4342
offset += badMatchTable[badMatchString]
4443
} else {
45-
offset += 1
44+
offset ++
4645
}
4746
}
4847
return -1

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy