Embed presentation
Download to read offline
![Write an algorithm for string Matching Input: An array T[0.n1] of n characters representing a
text and an array P[0.m1] of m characters representing a pattern Output: The index of the first
character in the text that starts a matching substring or -1 if the search is unsuccessful](https://image.slidesharecdn.com/writeanalgorithmforstringmatchinginputanarrayt0-230328131646-ae3e22d7/85/Write-an-algorithm-for-string-Matching-Input-An-array-T-0-n1-of-n-c-pdf-1-320.jpg)
The document outlines an algorithm for string matching, where the input consists of two arrays: one for text and one for a pattern. The output is the index of the first occurrence of the pattern in the text or -1 if no match is found. This algorithm is fundamental for searching substrings within larger strings.
![Write an algorithm for string Matching Input: An array T[0.n1] of n characters representing a
text and an array P[0.m1] of m characters representing a pattern Output: The index of the first
character in the text that starts a matching substring or -1 if the search is unsuccessful](https://image.slidesharecdn.com/writeanalgorithmforstringmatchinginputanarrayt0-230328131646-ae3e22d7/85/Write-an-algorithm-for-string-Matching-Input-An-array-T-0-n1-of-n-c-pdf-1-320.jpg)