Question 81
Which of the following statements regarding indirect recursion are CORRECT?
Detailed Solution
Indirect recursion cycles between functions, requires prototype visibility, pushes stack frames, and can overflow if unbounded.
Which of the following statements regarding indirect recursion are CORRECT?
Indirect recursion cycles between functions, requires prototype visibility, pushes stack frames, and can overflow if unbounded.
Which of the following traversal methods on a binary tree are inherently recursive?
Pre-order, In-order, and Post-order perform depth-first traversal naturally via recursion. Level-order uses an explicit queue iteratively.
Which of the following C storage classes CANNOT be used for variables that need to persist state across recursive call frames without being passed as parameters?
auto and register variables exist only within their single local activation frame. static and extern persist globally across frames.
Which of the following operations are performed during recursive stack frame teardown (unwinding)?
Stack unwinding deallocates local stack space, restores register pointers, and returns control. Static data segment is untouched.
Which of the following techniques can reduce or eliminate recursion stack overhead?
Memoization reduces subproblem calls, iteration eliminates stack frames, and TCO reuses frames. Adding variables increases stack usage.