Question: Alice is studying the Boyer - Moore algorithm's bad character rule, and she notices that if a mismatch occurs on the left side of the
Alice is studying the BoyerMoore algorithm's bad character rule, and she notices that if a mismatch occurs on the left side of the pattern, then the last occurrence table will more often than not be unhelpful. She thinks that one way to make the algorithm shift more effectively is to extend the last occurrence table from a HashMap from characters to indices to an array of HashMaps instead. The array is of length and the HashMap at each will store the last occurrences of the characters in
Bob hears of Alice's change to the algorithm and agrees that the algorithm will shift correctly, and that the shifts will be more effective, but that it might not always be a good idea due to tradeoffs. Select all of the statements that apply.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
