srbcheema1 / Algo_Ds

Repository for cool algorithms and Datastructures
182 stars 307 forks source link

Linear time pattern searching Algorithm #290

Open nuvishh opened 5 years ago

nuvishh commented 5 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.