8.5 Use a stack of activation records to trace the execution of the recursive fact method after an initial call of fact (4). Here is the method definition:
/**
/**
* Calculates n!.
*
* @param n the integer whose factorial is calculated.
*
* @return n!.
*
*/
protected static long fact (int n)
{
if (n <= 1)
return 1;
return n ∗ fact (n - 1);
} // method fact
 
 
View Solution
 
 
 
<< Back Next >>