✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Let T be a text of length
n and
P a pattern of length
m . The worst case time complexity of the naive algorithm is
O(n+m) .