Examveda

Consider the recursive implementation to find the nth fibonacci number:
Which line would make the implementation complete?
int fibo(int n)
    if n <= 1
	return n
    return __________

A. fibo(n) + fibo(n)

B. fibo(n) + fibo(n - 1)

C. fibo(n - 1) + fibo(n + 1)

D. fibo(n - 1) + fibo(n - 2)

Answer: Option D


Join The Discussion

Related Questions on Dynamic Programming in Data Structures