Fibonacci Sequence
Fib (N) = 1 if N <= 2 (two base cases)
= Fib (N-1) + Fib (N-2); if N > 2
Recursive solution:
int Fib( int N)
{
if (N <= 2) return 1;
else Fib(N-1) + Fib(N-2); }
Previous slide
Next slide
Back to first slide
View graphic version