MIT-Emerging-Talent / 2024-group-11-collaboration-practice

MIT License
0 stars 3 forks source link

Challenge: Knuth-Morris-Pratt Algorithm Python #39

Closed AnnaShliapkina closed 10 months ago

AnnaShliapkina commented 10 months ago

The implemented solution uses the Knuth-Morris-Pratt (KMP) algorithm to find the occurrences of pattern in text. The algorithm first preprocesses the pattern by calculating the longest prefix and suffix that are also a prefix of the pattern. It then uses this information to skip comparisons when searching for the pattern in the text, reducing the time complexity.

Code clear Add README All tests are green