- Computer Science Engineering (CSE)
- Design and Analysis of Algorithms
- What is the auxiliary space complexity o...

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

View all MCQs in:
Design and Analysis of Algorithms

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

Login to Continue

It will take less than 2 minutes

Report MCQ