Dynamic Programming21 sections · 916 units
Open in CourseQuiz: 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 ?
- A.sum(n) = (n mod 10) + sum(n / 10)
- B.sum(n) = n + sum(n - 1)
- C.sum(n) = sum(n - 10) + 10
- D.sum(n) = n / 10 + n mod 10