What is the time complexity of Z algorithm for pattern searching (m = length of text, n = length of pattern)?
(a) O(n + m)
(d) O(m * n)
I had been asked this question in a job interview.
My question is from Searching topic in portion Searching of Data Structures & Algorithms II