Concept Flow - String Pattern Matching Naive
Start at text index i=0
Compare pattern with text at i
Match all pattern chars?
Yes→Record match at i
No
Increment i by 1
Check if i <= text_len - pattern_len
Yes
Repeat
No
End
The algorithm tries to match the pattern starting at each position in the text one by one until it reaches the end.
