Loading practice questions
What is the time complexity of the brute force algorithm used to find the length of the longest palindromic subsequence?
Correct Answer: B — O(2^{n})
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.