question 1
Rabin-Karp looks for idz in zzvrpidz. The fingerprints agree only at places 5 and 6. How many letter comparisons does it make?
the answer, and why
the answer is B
Place 5, pid: p is not i, 1. Place 6, idz: i, d and z match, 3. No other place compares. That is 4.
if you chose another
- That compares all 3 letters at both places, but place 5 stops at its first letter.
- That counts only the match, not the chance agreement at place 5.
- That compares all 3 letters at all 6 places, the most any search of 8 letters and 3 could make.