| Paste number 81454: | Java reference code in algorithms lecture |
| Pasted by: | [bjoern] |
| When: | 2 years, 8 months ago |
| Share: | Tweet this! | http://paste.lisp.org/+1QUM |
| Channel: | #swhack |
| Paste contents: |
public static void computeFailValues(int fi, int pi){
if (fi < pattern.length()){
if (pattern.charAt(pi) == pattern.charAt(fi)){
fail[fi] = pi + 1;
computeFailValues(fi + 1, pi + 1);
}
else if (pi > 0)
computeFailValues(fi, fail[pi - 1]);
else {fail[fi] = 0;
computeFailValues(fi + 1, pi);
}
}
}
This paste has no annotations.