Dynamic Programming21 sections · 916 units
Open in Course

Quiz: Recursive Structure

Test your understanding

Check Your Understanding

For the sum of digits problem, what is the recursive formula to compute the sum of digits of nn?

  1. A.sum(n) = (n mod 10) + sum(n / 10)
  2. B.sum(n) = n + sum(n - 1)
  3. C.sum(n) = sum(n - 10) + 10
  4. D.sum(n) = n / 10 + n mod 10
Start the roadmap to answer the quizzes and solve the challenges