🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: DP on Grids and Strings: all 10 questions

Quiz: DP on Grids and Strings · Question 10 of 10

You reduce the LCS table to two rows to save memory. What do you lose?

You reduce the LCS table to two rows to save memory. What do you lose?

  1. A.The correct length of the LCS
  2. B.The ability to walk back through the table to rebuild the actual subsequence
  3. C.The O(n · m) time
  4. D.Nothing at all
Answer & explanation

Correct answer: The ability to walk back through the table to rebuild the actual subsequence

The length is still correct, but the earlier rows needed for reconstruction are gone.

Can you get the rest right without peeking?

Take the timed Quiz: DP on Grids and Strings quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →