0

What are the steps I need to take to work out the time complexity of this function in terms of N? Or any function?

I'm essentially asking how to evaluate algorithm complexity in Big O notation?

int f(int N) {

if (N<2) return 1;

return f(N-1)+f(N-2);

}
Conor
  • 17
  • 1
  • 4
  • Can at least try to show some effort in the solution or how you approached the problem? Otherwise this looks like a homework question. – Ivan May 12 '15 at 16:37
  • I'm not looking for the answer just want to know what steps to take. You can even use a different method. Thanks – Conor May 12 '15 at 16:43
  • So the question is about how to evaluate algorithm complexity in Big O notation, instead of the performance of the Fibonacci algorithm? I'm confused. – Ivan May 12 '15 at 17:26
  • possible duplicate of [Computational complexity of Fibonacci Sequence](http://stackoverflow.com/questions/360748/computational-complexity-of-fibonacci-sequence) — the accepted answer goes into **LOTS** of detail. – Wai Ha Lee May 12 '15 at 18:46
  • See also "[*How to find time complexity of an algorithm*](http://stackoverflow.com/q/11032015/1364007)" for some more info. – Wai Ha Lee May 12 '15 at 18:50

0 Answers0