Naïve String Matching Algorithm
It employs a Brute Force technique to identify the presence of a pattern in the given text.
It is not efficient algorithm because it takes the time complexity of the algorithm to check for a sub string is O((m-n)n) where m is the length of the text and n is the length of the pattern (sub string) to be searched.
There is no preprocessing is required for this algorithm unlike KMP algorithm.
Preprocessing time: 0 (no preprocessing)
Matching time: O((n-m)m).