✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Let S be a string of length
n . Suppose we are in iteration
k of Z-algorithm when run on
S and assume
k > r_{k-1}. As we are in case 1 we must compute
Z[k] using explicit comparisons.