I am reading about KMP for string matching. It needs a preprocessing of the pattern by building a prefix table. For example for the string ababaca
KMP
ababaca
String string = "abababca"; int[]array = new int[string.length()]; int i = 1; int j = 0; while(i