Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1 When a function calls another function which eventually calls the original fun

ID: 3547191 • Letter: 1

Question


1 When a function calls another function which eventually calls the original function, the process is called.


2 Differentiate between a direct recursion and an indirect recursion?


3    True or false: the middle elements of a stack can be accessed directly.


4 The operation for adding an entry to a stack is traditionally called:

a. add

b. append

c. insert

d. push


5 The first step of a maze search algorithm may be to step forward and write your name on the ground. What is the importance of writing your name on the ground?


6 Write the recurrence (recursive) relation for the factorial function in terms of f(n).  For example 5! = 5 x 4 x 3 x 2 x 1).


7. Choose one of the following that

Explanation / Answer

1. Indirect recursion.

2. Indirect recursion occurs when a function is called not by itself but by another function.

Direct recursion, in which a function calls itself.

3. No , only the top element can be accessed(generally).

4. d push

5. Note down the visited nodes

6. fac(i) = fac(i-1) * i

7. a Create several base cases ( not always possible )

8. Fibonacci