question 1
Rabin-Karp looks for zke in fstzkeibvx. The fingerprints agree only at places 2 and 4. How many letter comparisons does it make?
the answer, and why
the answer is A
Place 2, stz: s is not z, 1. Place 4, zke: z, k and e match, 3. No other place compares. That is 4.
if you chose another
- That compares all 3 letters at both places, but place 2 stops at its first letter.
- That counts only the match, not the chance agreement at place 2.
- That compares all 3 letters at all 8 places, the most any search of 10 letters and 3 could make.