Question: Consider a recursive function sumDigit sR (num) that returns the sum of the digits of the input parameter, which is an integer called num. It

Consider a recursive function sumDigit sR (num) that returns the sum of the digits of the input parameter, which is an integer called num. It can be assumed that 'num' is a non-negative For example: sumDigitsR (1983)=21. If sumDigitsR was re-written into an iterative version, what would be the space complexity of the iterative algorithm? O(n2) O(n) O(1) O(logn) None of the other answers are correct
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
