Which algorithm efficiently finds the longest common subsequence of two sequences?
-
A
Naive Recursion
-
B
Dynamic Programming
Correct answer
-
C
Greedy Algorithm
-
D
Divide and Conquer
Correct answer
B. Dynamic Programming
17 views
Explanation
The dynamic programming approach solves LCS in O(mn) time and space.
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ