Closed prasadvpatil closed 4 years ago
I would like to work upon this in C @Kajol-Kumari @Abhijit2505 @SKAUL05 @plazzy99
i will do it in python3,Pls assign it to me.
Hey @prasadvpatil let's not go with the brute force algorithm for this as it's quiet naive! Maybe go for Rabin–Karp
or Boyer–Moore string-search algorithm
for this.
I will work upon it in C++ @Kajol-Kumari @SKAUL05
Please reopen this issue once you add more information and updates here. If this is not the case and you need some help, feel free to seek help from our Telegram or ping one of the reviewers. Thank you for your contributions!
🚀 Feature
Align the pattern against the first m characters of the text and start matching the corresponding pairs of characters from left to right until either all m pairs of characters match or a mismatching pair is encountered. In the latter case, shift the pattern one position to the right and resume character comparisons, starting again with the first character of the pattern and its counterpart in the text.
Have you read the Contributing Guidelines on Pull Requests?
Yes
Motivation
Its one of the easy method to implement string search. Helps for beginners to learn and implement basic codes first.
Pitch
We can implement according to the below algorithm.
Brute_Force_String_Match (T[0…n-1], P[0…m-1]) // Implements brute force string match // Input:- An array T[0…n-1] of n characters representing a text and an array P[0…m-1] 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