GATEverse Practice, past papers & mock tests
GATE 2026 · session-8
Programming, Data Structures and AlgorithmsProgramming in PythonmediumMCQ2 marks
A recursive function in Python is given. def mystery(n): if n <= 0: return 1 else: return mystery(n-1) + mystery(n-2) Now, consider the following function call: mystery(4) Assume that a typical runtime stack is used to manage function calls. Each function call is pushed onto the stack and removed only after it finishes execution. Which of the following options denotes the total number of function calls (i.e., the total number of stack activations), including the initial call, to compute mystery(4)?
Save your progress

Related Programming, Data Structures and Algorithms PYQs