Python Reading
- Read Recursion from the section entitled What is Recursion? through the section entitled Converting an Integer to a String in Any Base.
Class Activity
- Consider the problem of determining the sum of the
consecutive integers from 0 through n.
Assume n is supplied by the user.
- Implement an iterative solution to this problem.
- Implement a recursive solution to this problem.
- For the recursive solution, what is the base case?
- For the recursive solution, what is the general case?
- Implement a formulaic solution to this problem.
Active Learning Activity
- Implement the Fibonacci
function using recursion. Test the function for correctness.
- Implement Fibonacci using iteration.
- Which Fibonacci implementation is easier to understand? Explain.
- Which implementation is simpler? Explain.
- Which implementation is better? Explain.
Other Programming Languages