If n is the length of text(T) and m is the length of the pattern(P) identify the correct pre-processing algorithm. (where q is a suitable modulus to reduce the complexity)
p=0; t0=0;
A.
for i=1 to n
do t0=(dt0 + P[i])mod q
p=(dp+T[i])mod qB.
for i=1 to n
do p=(dp + P[i])mod q
t0=(dt0+T[i])mod qC.
for i=1 to m
do t0=(dp + P[i])mod q
p=(dt0+T[i])mod qD.
for i=1 to m
do p=(dp + P[i])mod q
t0=(dt0+T[i])mod qAnswer: Option D

Join The Discussion