$./bm-computed
pattern:
2 step/s
# algorithm
1ComputeD(p) {m = |p|}
2begin
3 jRnext[m]m + 1
4 for im downto 1 do
5 while jm and p[i]p[j] do
6 if D[j] undefined then D[j]ji
7 jRnext[j]
8 od
9 jj1; Rnext[i1]j
10 od
11 pRnext[0]
12 for j0 to m do
13 if D[j] undefined then D[j]p
14 if j = p then pRnext[p]
15 od
16end
# pattern (1-indexed)
no data
# variables
i
j
p (var)
m
10
p[i]
p[j]
# D array - Good Suffix Shift (0-indexed)
no data
# Rnext array - Reverse Next (0-indexed)
no data
# current action
enter a pattern and click "run" to begin...
# assignment history
stepijDRnextaction