Draw the recursion trace for the execution of the function Recursive.

Question:

Draw the recursion trace for the execution of the function Recursive.

Algorithm Recursive (x):
Input: Integer x
Output: Integer d
if x > 7
d = 5
else if x = 7
d = 3
else
d = Recursive (x + 3) + Recursive(x + 1)
return d

Answer:

Leave a Comment

Your email address will not be published. Required fields are marked *