Data Structure Questions and Answers-Longest Palindromic Subsequence

 

 Help authour, Buy PDF Ebook   >>>Click Here<<<

Data Structure Questions and Answers-Longest Palindromic Subsequence

Click on any option to know the CORRECT ANSWERS

Question 1
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
Visual arts Questions answers

Question 1 Explanation: 
All of the mentioned methods can be used to solve the longest palindromic subsequence problem.

Question 2
Which of the following strings is a palindromic subsequence of the string "ababcdabba"?
A
abcba
B
abba
C
abbbba
D
all of the mentioned
Microbiology Questions answers

Question 2 Explanation: 
All of the mentioned strings are palindromic subsequences of the string "ababcdabba".

Question 3
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
Reading comprehension Questions answers

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
What is the length of the longest palindromic subsequence for the string "ababcdabba"?
A
6
B
7
C
8
D
9
Biology Questions answers

Question 4 Explanation: 
The longest palindromic subsequence is "abbabba" and its length is 7.

Question 5
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)
UPSC Questions answers

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.

There are 5 questions to complete.

 

 Download all FREE PDF Ebook >>>CLICK HERE<<<