|
|
 |
|
 |
|
|
Tail Recursion A recursive algorithm in which no statements are executed after the return from the recursive call. |
|
|
|
|
|
|
|
|
Figure 19-4 shows the execution of the Print function with the values of the actual parameters for each call. Notice that the array gets smaller with each recursive call (list[first]list[last]). If we want to print the array elements in reverse order recursively, all we have to do is interchange the two statements within the If statement. |
|
|
|
|
|
|
|
|
Figure 19-4
Execution of Print(list, 0, 4) |
|
|
|
|
|