-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Open
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Description
I think there is a wrong claim in the notes about two-way algorithm.
cpython/Objects/stringlib/stringlib_find_two_way_notes.txt
Lines 352 to 353 in 255eb37
If p is a substring of s and p has period r, then the period | |
of s is either equal to r or greater than len(p). |
Let s = (abcccd)^2 = abcccdabcccd
and p = ccdabcc
of length len(p) = 7
and period r = 5
.
The period of the whole string s
is 6, which is strictly greater than r
but strictly smaller than len(p)
.
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Projects
Status
Todo