Data Structure Questions and Answers-Longest Palindromic Subsequence

DOWNLOAD FREE PDF <<CLICK HERE>>

Data Structure Questions and Answers-Longest Palindromic Subsequence

Congratulations - you have completed Data Structure Questions and Answers-Longest Palindromic Subsequence.

You scored %%SCORE%% out of %%TOTAL%%.

Your performance has been rated as %%RATING%%


Your answers are highlighted below.
Question 1 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER]
Which of the following methods can be used to solve the longest palindromic subsequence problem?
A
Dynamic programming
B
Recursion
C
Brute force
D
All of the mentioned
Question 1 Explanation: 
All of the mentioned methods can be used to solve the longest palindromic subsequence problem.

Question 2 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER]
Which of the following strings is a palindromic subsequence of the string "ababcdabba"?
A
abcba
B
abba
C
abbbba
D
all of the mentioned
Question 2 Explanation: 
All of the mentioned strings are palindromic subsequences of the string "ababcdabba".

Question 3 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER]
For which of the following, the length of the string is equal to the length of the longest palindromic subsequence?
A
A string that is a palindrome
B
A string of length one
C
A string that has all the same letters(e.g. aaaaaa)
D
All of the mentioned
Question 3 Explanation: 
In all the above cases, the string itself is the longest palindromic subsequence and hence the length of the longest palindromic subsequence is equal to the length of the string.

Question 4 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER]
What is the length of the longest palindromic subsequence for the string "ababcdabba"?
A
6
B
7
C
8
D
9
Question 4 Explanation: 
The longest palindromic subsequence is "abbabba" and its length is 7.

Question 5 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER]
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)
Question 5 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.

Once you are finished, click the button below. Any items you have not completed will be marked incorrect. Get Results
There are 5 questions to complete.

DOWNLOAD FREE PDF <<CLICK HERE>>