Lab Activity 5.2
Source Code
import java.util.ArrayList;
import java.util.List;
public class BadCharacterRule {
public List<Integer> match(String P, String T) {
int n = T.length();
int m = P.length();
int e = 256;
int left[][] = new int[m][e];
// Populate left[][] with the correct values
// Add the code from Snippet 5.3 to search the string using bcr
return shifts;
}
public static void main(String[] args) {
/*
* This main method is a stub.
* It does nothing.
* Feel free to write your own code to test your implementation.
* In this case, we have nothing actionable in here, just this comment block, so the JVM should rapidly lose interest and move on to the rest of your code.
*/
}
}Last updated