public int[] computePrefix(String pattern) {
		int patternLength = pattern.length(); int longestPrefix = 0;
		int[] prefixFunction = new int[patternLength];
		prefixFunction[0] = 0;
		for(int patternIndex = 1; patternIndex < patternLength; patternIndex++) {
			while(longestPrefix > 0 && !this.compareTwoChars(pattern.charAt(longestPrefix) , pattern.charAt(patternIndex))) 
				longestPrefix = prefixFunction[longestPrefix-1];
			if(this.compareTwoChars(pattern.charAt(longestPrefix),pattern.charAt(patternIndex)))
				longestPrefix = longestPrefix+1;
			prefixFunction[patternIndex] = longestPrefix;
			comparisons++;
		}
		return prefixFunction;
	}