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. | |
View all MCQs in
Design and Analysis of AlgorithmsNo comments yet