McqMate

Q. |
## What is the time complexity of the brute force algorithm used to find the length of the longest palindromic subsequence? |

A. | o(1) |

B. | o(2n) |

C. | o(n) |

D. | o(n2) |

Answer» B. o(2n) | |

Explanation: in the brute force algorithm, all the subsequences are found and the length of the longest palindromic subsequence is calculated. this takes exponential time. |

3.4k

0

Do you find this helpful?

17

View all MCQs in

Design and Analysis of AlgorithmsNo comments yet

- In general, which of the following methods isn’t used to find the factorial of a number?
- Which of the following recursive formula can be used to find the factorial of a number?
- Which of the following recurrence relations can be used to find the nth fibonacci number?
- What is the computational complexity of Binary GCD algorithm where a and b are integers?
- Which algorithm is the most efficient numerical algorithm to obtain lcm?
- Which of the following methods can be used to find the sum of digits of a number?
- What is the time complexity of the above code used to reverse a string?
- What is the time complexity of the above recursive implementation used to reverse a string?
- What is the time complexity of matrix multiplied recursively by Divide and Conquer Method?
- Is Coppersmith-Winograd algorithm better than Strassen’s algorithm in terms of time complexity?