Recursion

Steven Zeil

Old Dominion University, Dept. of Computer Science

Table of Contents

1. Recursion
1.1. A Pattern for Recursive Algorithms
1.2. A Silly Example of Recursion
1.3. How to Get In Trouble With Recursion
1.4. When to Think 'Recursion!'
2. Example: Compressing a Picture
3. Example: Calculator
3.1. How Do We Evaluate An Expression?
3.2. Example: 2 / ( 1 + 3 )
3.3. Starting the Evaluation
3.4. Evaluating an Expression
3.5. Evaluating a Product
3.6. Evaluating a Term
3.7. Example: evaluating 2 / ( 1 + 3 )
3.8. Calculator Program