1.

The complexity of Fibonacci series is _________(a) O(2^n)(b) O(log n)(c) O(n^2)(d) O(n log n)I have been asked this question in an interview for job.I need to ask this question from Algorithms topic in division Algorithms of Discrete Mathematics

Answer»

Right choice is (a) O(2^N)

For EXPLANATION: Fibonacci is f(n) = f(n-1) + f(n-2), f(0) = 0, f(1) = 1. LET g(n) = 2^n. Now prove inductively that f(n) > = g(n).



Discussion

No Comment Found

Related InterviewSolutions