lundi 10 août 2020

Hash Pattern questions

Consider the example pattern and text below. Each character in the patter and text is a digit 0-9 (no ASCII will be used or needed here, i.e '7' character is numerical value 7 also).

Index 0 1 2 3 4 Pattern 2 4 3 9 7

Index 0 1 2 3 4 5 6 7 8 9 10 11 Text 4 3 9 9 6 9 6 8 1 1 2 3

1- Using the pattern and text examples and what is hash(pattern) = _________ * 0 3 5 7 8 10 2- Using the pattern and text examples. How many times will the "Simplified" Rabin-Karp algorithm be able to "quickly" detect a mismatch between the pattern and the text (i.e. detect a mismatch in constant time)? * 0 1 2 3 4 5 6 7 8 12

Aucun commentaire:

Enregistrer un commentaire