Consider a simple recursive method (Java code written by yourself
Consider a simple recursive method (Java code written by yourself
or taken from Web) such as calculating the sum of the first n natural numbers, calculating the number of digits of an integer number, calculating 2 to the power of n, etc. Try choosing one different from that of any posted thus far.
a. Show method code, indicate what it does, identify the base case(s) and indicate how each recursive call simplifies the problem and makes progress towards the base case;
b. Provide an equivalent iterative implementation.
c. How do the two implementations compare