🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Dynamic Programming Quiz: all 8 questions

Dynamic Programming Quiz · Question 8 of 8

How is the time complexity of a DP solution usually estimated?

How is the time complexity of a DP solution usually estimated?

  1. A.Number of states × work per state
  2. B.Always O(n²)
  3. C.Number of base cases
  4. D.Depth of recursion only
Answer & explanation

Correct answer: Number of states × work per state

E.g. LCS has m × n states with O(1) work each → O(m·n).

Can you get the rest right without peeking?

Take the timed Dynamic Programming Quiz quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →