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

Discussion

No comments yet