Paste number 81454: Java reference code in algorithms lecture

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:
Raw Source | XML | Display As
    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.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.