1. Computer Science Engineering (CSE)
  2. Design and Analysis of Algorithms
  3. Which of the following recurrence relati...
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.

Discussion