What is the auxiliary space complexity of Z algorithm for pattern searching (m = length of text, n = length of pattern)?
|A.||o(n + m)|
|D.||o(m * n)|
|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.|
Login to Continue
It will take less than 2 minutes