Question: 5.2 What is the computational complexity of pre-processing in the context of the Boyer-MooreHorspool algorithm (that is, constructing a shift table) and pre-processing in the

5.2 What is the computational complexity of pre-processing in the context of the Boyer-MooreHorspool algorithm (that is, constructing a shift table) and pre-processing in the context of the Rabin-Karp algorithm (that is, constructing a fingerprint), with m denoting the length of the pattern P,n the length of the text T, and s the length of the alphabet ? (a) Boyer-Moore-Horspool: O(1), Rabin-Karp: O(1) (b) Boyer-Moore-Horspool: O(m), Rabin-Karp: O(1) (c) Boyer-Moore-Horspool: O(s), Rabin-Karp: O(1) (d) Boyer-Moore-Horspool: O(1), Rabin-Karp: O(m) (e) Boyer-Moore-Horspool: O(m), Rabin-Karp: O(m) (f) Boyer-Moore-Horspool: O(s), Rabin-Karp: O(m)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
