Data Structure Questions and Answers-Longest Common Subsequence

 

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

Data Structure Questions and Answers-Longest Common Subsequence

Click on any option to know the CORRECT ANSWERS

Question 1
Which of the following methods can be used to solve the longest common subsequence problem?
A
Recursion
B
Dynamic programming
C
Both recursion and dynamic programming
D
None of the mentioned
Reasoning Questions answers

Question 1 Explanation: 
Both recursion and dynamic programming can be used to solve the longest subsequence problem.

Question 2
Consider the strings "PQRSTPQRS" and "PRATPBRQRPS". What is the length of the longest common subsequence?
A
9
B
8
C
7
D
6
EVS Questions answers

Question 2 Explanation: 
The longest common subsequence is "PRTPQRS" and its length is 7.

Question 3
Which of the following problems can be solved using the longest subsequence problem?
A
Longest increasing subsequence
B
Longest palindromic subsequence
C
Longest bitonic subsequence
D
None of the mentioned
Current affairs Questions answers

Question 3 Explanation: 
To find the longest palindromic subsequence in a given string, reverse the given string and then find the longest common subsequence in the given string and the reversed string.

Question 4
Longest common subsequence is an example of .....
A
Greedy algorithm
B
2D dynamic programming
C
1D dynamic programming
D
Divide and conquer
Sociology Questions answers

Question 4 Explanation: 
Longest common subsequence is an example of 2D dynamic programming.

Question 5
What is the time complexity of the brute force algorithm used to find the longest common subsequence?
A
O(n)
B
O(n2)
C
O(n3)
D
O(2n)
GK Questions answers

Question 5 Explanation: 
The time complexity of the brute force algorithm used to find the longest common subsequence is O(2n).

There are 5 questions to complete.

 

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