0
21kviews
Explain naive string matching algorithm with example.
1 Answer
1
490views
  1. The naive algorithm finds all valid shifts using a loop that checks the condition P [1 . . m] = T[s + 1 . . s + m] for each of the n - m + 1 possible values of s.
  2. NAIVE-STRING-MATCHER(T, P)

    1 n   length [T]
    2 m   length …

Create a free account to keep reading this post.

and 3 others joined a min ago.

Please log in to add an answer.