Consider the following recursive definition of fib: fib(n) := if n = 0 then 1…

GATE · 1991 · CS · Question 1 subparts

Consider the following recursive definition of fib:

fib(n) := if n = 0 then 1

else if n = 1 than 1

else fib(n - 1) + fib(n - 2)

The number of times fib is called (including the first call) for an evaluation of fib(7) is __________

Attempted by 14 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…