Module gopy.strings

Expand source code
name="strings"


from .knuth_morris_pratt import match
from .naive_string_match import match
from .rabin_karp import match

Sub-modules

gopy.strings.knuth_morris_pratt

Knuth-Morris and Pratt introduce a linear time algorithm for the string matching problem. A matching time of O (n) is achieved by avoiding comparison …

gopy.strings.naive_string_match

The naïve approach tests all the possible placement of Pattern P [1.......m] relative to text T [1......n]. We try shift s = 0, 1.......n-m, …

gopy.strings.rabin_karp

The Rabin-Karp string matching algorithm calculates a hash value for the pattern, as well as for each M-character subsequences of text to be compared …