We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 787198c commit 2bdaf6dCopy full SHA for 2bdaf6d
kmp.rb
@@ -1,5 +1,4 @@
1
#Knuth–Morris–Pratt algorithm (KMP) algorithm, http://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm
2
-
3
def kmp str, ptrn
4
m = i = 0
5
t = compute_table ptrn
0 commit comments