
Learn core concepts, essential formulas, and attempt practice questions designed on the latest TCS NQT testing patterns.
Find length of LCS of 'ABCD' and 'ACDF':
Correct Answer: A) 3
Step-by-step Solution: The common subsequence is 'ACD', which has length 3.
What is time complexity of LCS of two strings of size M and N using DP?
Correct Answer: A) O(M * N)
Step-by-step Solution: The DP table size is M x N. Filling each cell takes O(1) time. Total time complexity = O(M * N).
Draw the DP table and trace the character matching arrows to understand the backtracking recovery path.