mirror of
https://hub.njuu.cf/TheAlgorithms/Python.git
synced 2023-10-11 13:06:12 +08:00
Typo in comment rabin_karp.py (#1820)
* Update rabin_karp.py fix: typo * Update rabin_karp.py Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
parent
f17e9822b0
commit
9b376a5bfb
@ -40,7 +40,7 @@ def rabin_karp(pattern, text):
|
||||
return True
|
||||
if i == t_len - p_len:
|
||||
continue
|
||||
# Calculating the ruling hash
|
||||
# Calculate the https://en.wikipedia.org/wiki/Rolling_hash
|
||||
text_hash = (
|
||||
(text_hash - ord(text[i]) * modulus_power) * alphabet_size
|
||||
+ ord(text[i + p_len])
|
||||
|
Loading…
Reference in New Issue
Block a user