McqMate
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. |
View all MCQs in
Design and Analysis of AlgorithmsNo comments yet