Skip to content

Commit 1d28138

Browse files
📚 docs(build): Add link to original paper.
1 parent 6a788ba commit 1d28138

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/build.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
* Computes for each j the largest 0 <= i < j such that
33
* p.slice(0, i) is p.slice(j-i, j).
44
*
5+
* This is the "f[j]" table found in
6+
* "Fast pattern matching in strings" by Knuth, Morris, and Pratt,
7+
* although here indices are 0-based hence all indices and inputs are one less
8+
* than in that paper.
9+
*
510
* @param {ArrayLike} p
611
* @param {number} pi
712
* @param {number} pj

0 commit comments

Comments
 (0)