Skip to content

Commit 6422cc2

Browse files
Updating README.md.
1 parent fb95569 commit 6422cc2

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -682,23 +682,23 @@ Which can be summarized with the following table:
682682

683683
#### How KMP uses the suffix-oriented table
684684

685-
During search, if you have matched `j` characters and then get a mismatch:
685+
Assume that `j` characters have been matched, and then a mismatch occurs.
686686

687-
Instead of:
687+
Instead of the following:
688688

689689
```text
690690
textIndex = textIndex - j + 1
691691
692692
j = 0
693693
```
694694

695-
You do:
695+
We can simply do:
696696

697697
```text
698698
j = kmpBorders[j - 1]
699699
```
700700

701-
And continue from the already-known partial match.
701+
This allows continuation from the already-known partial match.
702702

703703
This is what gives KMP its linear time, since each character in the text is processed at most once.
704704

0 commit comments

Comments
 (0)