Which of the following lines completes the above code?
strrev(str2)
str2 = str1
len2 = strlen(str2)
strlen(str2)
8 practice sets · Page 1 of 1
Which of the following lines completes the above code?
strrev(str2)
str2 = str1
len2 = strlen(str2)
strlen(str2)
Longest palindromic subsequence is an example of ______________
Greedy algorithm
2D dynamic programming
1D dynamic programming
Divide and conquer
For every non-empty string, the length of the longest palindromic subsequence is at least one.
True
False
What is the time complexity of the brute force algorithm used to find the length of the longest palindromic subsequence?
O(1)
O(2^{n})
O(n)
O(n^{2})
What is the length of the longest palindromic subsequence for the string "ababcdabba"?
6
7
8
9
For which of the following, the length of the string is not equal to the length of the longest palindromic subsequence?
A string that is a palindrome
A string of length one
A string that has all the same letters(e.g. aaaaaa)
Some strings of length two
Which of the following is not a palindromic subsequence of the string "ababcdabba"?
abcba
abba
abbbba
adba
Which of the following methods can be used to solve the longest palindromic subsequence problem?
Dynamic programming
Recursion
Brute force
Dynamic programming, Recursion, Brute force