displaying activation records

This commit is contained in:
Jidong Xiao
2023-09-19 23:23:14 -04:00
parent a510e367eb
commit 538ec774a7

View File

@@ -145,9 +145,7 @@ for (int j=i; j<n; ++j)
![alt text](factorial_equation.png "factorial equation")
- Computing integer powers is defined as:
<div style="margin-top: 10px;">
![alt text](power_equation.png "power equation")
</div>
These are both examples of recursive definitions.
@@ -188,6 +186,7 @@ confusing since there are multiple activation records waiting for an answer from
- This is illustrated in the following diagram of the call fact(4). Each box is an activation record, the solid lines
indicate the function calls, and the dashed lines indicate the returns. Inside of each box we list the parameters
and local variables and make notes about the computation.
![alt_text](activation_records.png "chain of activation records")
- This chain of activation records is stored in a special part of program memory called the stack
## 7.13 Iteration vs. Recursion