Loading practice questions
What is the auxiliary space complexity of Z algorithm for pattern searching (m = length of text, n = length of pattern)?
Correct Answer: B — O(m)
Explanation:
Z algorithm is an efficient pattern searching algorithm as it searches the pattern in linear time. It an auxiliary space of O(m) for maintaining Z array.