question 1
Rabin-Karp looks for yqd in atbyyqdqk. The fingerprints agree only at places 1 and 5. How many letter comparisons does it make?
the answer, and why
the answer is C
Place 1, atb: a is not y, 1. Place 5, yqd: y, q and d match, 3. No other place compares. That is 4.
if you chose another
- That compares all 3 letters at both places, but place 1 stops at its first letter.
- That counts only the match, not the chance agreement at place 1.
- That compares all 3 letters at all 7 places, the most any search of 9 letters and 3 could make.