1: It is simple and uses brute force approach.
2: It compares first character of pattern with searchable text. If match is found, pointers in both strings are advanced. If match not found, pointer of text is incremented and pointer of pattern is reset. This process is repeated until the end of the text.
3: It directly starts comparing both strings character by character.
1: It is simple and uses brute force approach. 2: It compares first character of pattern with searchable text. If match is found, pointers in both strings are advanced. If match not found, pointer of text is incremented and pointer of pattern is reset. This process is repeated until the end of the text. 3: It directly starts comparing both strings character by character.