srbcheema1 / Algo_Ds

Repository for cool algorithms and Datastructures
183 stars 306 forks source link

Linear time pattern searching Algorithm #290

Open nuvishh opened 4 years ago

nuvishh commented 4 years ago

This algorithm finds all occurrences of a pattern in a text in linear time. Let the length of text be n and of the pattern be m, then total time taken is O(m + n) with linear space complexity.