A modified Naive Pattern Searching algorithm that is optimized for the cases when all characters of pattern are different
void search ( char pat [ ] , char txt [ ] ) { int M = strlen ( pat ) ; int N = strlen ( txt ) ; int i = 0 ; while ( i <= N - M ) { int j ;