Question

What is the time complexity of the KMP algorithm for searching a pattern of length 'M' in a text of length 'N'?

A O(MN)
B O(N log M)
C O(N + M)
D O(M^2)
E O(N^2)
Practice Next

Hey! Ask a query