Skip to content

Commit 9b376a5

Browse files
emirotcclauss
andauthored
Typo in comment rabin_karp.py (TheAlgorithms#1820)
* Update rabin_karp.py fix: typo * Update rabin_karp.py Co-authored-by: Christian Clauss <cclauss@me.com>
1 parent f17e982 commit 9b376a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

strings/rabin_karp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def rabin_karp(pattern, text):
4040
return True
4141
if i == t_len - p_len:
4242
continue
43-
# Calculating the ruling hash
43+
# Calculate the https://en.wikipedia.org/wiki/Rolling_hash
4444
text_hash = (
4545
(text_hash - ord(text[i]) * modulus_power) * alphabet_size
4646
+ ord(text[i + p_len])

0 commit comments

Comments
 (0)