| 1 3 2| | 1 2 3 4| | 9 4 2| | 1x1+2x9+3x7+4x5 1x3+2x4+3x4+4x8 1x2+2x2+3x1+4x2| | 2 4 1 3| x | 7 4 1| | ... ... | | 2 7 5 3| | 5 8 2| | ... 2x2+7x2+5x1+3x2|
BRUTE_MATCH(T,P)
- L ← []
- fori ← 0 to T.size()-P.size() do
- S ← T.substring(i, P.size());
- if (S = P) then
- L.append(i)
- return L