Q.

Which of the following recurrence relations can be used to find the nth fibonacci number?

A. f(n) = f(n) + f(n – 1)
B. f(n) = f(n) + f(n + 1)
C. f(n) = f(n – 1)
D. f(n) = f(n – 1) + f(n – 2)
Answer» D. f(n) = f(n – 1) + f(n – 2)
Explanation: the relation f(n) = f(n – 1) + f(n – 2) can be used to find the nth fibonacci number.
744
0
Do you find this helpful?
1

Discussion

No comments yet