McqMate

Q. |
## What is the auxiliary space complexity of Z algorithm for pattern searching (m = length of text, n = length of pattern)? |

A. | o(n + m) |

B. | o(m) |

C. | o(n) |

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. |

2.8k

0

Do you find this helpful?

8

View all MCQs in

Design and Analysis of AlgorithmsNo comments yet

- What is the worst case time complexity of KMP algorithm for pattern searching (m = length of text, n = length of pattern)?
- What is the time complexity of Z algorithm for pattern searching (m = length of text, n = length of pattern)?
- Rabin Karp algorithm and naive pattern searching algorithm have the same worst case time complexity.
- What will be the auxiliary space complexity of dynamic programming solution of set partition problem(sum=sum of set elements)?
- The naive pattern searching algorithm is an in place algorithm.
- What is the space complexity of the divide and conquer algorithm used to find the maximum sub-array sum?
- What is the space complexity of Kadane’s algorithm?
- Is Coppersmith-Winograd algorithm better than Strassen’s algorithm in terms of time complexity?
- What is the time complexity of the brute force algorithm used to find the length of the longest palindromic subsequence?
- What is the space complexity of program to reverse stack recursively?