Recursion

Dr. Tim McGuire
CS 272
Sam Houston State University

Overview

Recursive Procedures

int fact(int n)
{
if (n == 0)
   return 1;
else
   return n * fact(n-1);
}

Passing Parameters on the Stack

The Activation Record

Implementation of Recursive Procedures