Knuth-Morris-Pratt string search: Difference between revisions
Content added Content deleted
(J) |
m (→{{header|J}}: trivial optimization) |
||
Line 75: | Line 75: | ||
end. |
end. |
||
else. |
else. |
||
whilst. _1<k do. |
|||
if. ch=x{~k=. k{T do. break. end. |
if. ch=x{~k=. k{T do. break. end. |
||
end. |
end. |
||
Line 95: | Line 95: | ||
(J uses index 0 for the first character in a sequence of characters.) |
(J uses index 0 for the first character in a sequence of characters.) |
||
=={{header|Julia}}== |
=={{header|Julia}}== |