Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations - NIMCET

Previous Year Question (PYQs)



The longest common subsequence of $\{1,2,3,2,4,1,2\}$ and $\{2,4,3,1,2,1\}$ is





Solution

Why: The LCS length for the two sequences is $4$. $2,3,2,1$ is a subsequence of both: $\{1,\underline{2},3,\underline{2},4,1,\underline{2}\}$ and $\{\underline{2},4,\underline{3},1,\underline{2},\underline{1}\}$. Option (4) has length $5$ (too long), and (1), (2) are not subsequences of both.



Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Ask Your Question or Put Your Review.

loading...