Recursion/Programs/fibonacci.cpp
//recurssive function to find fibonacci series
//the problem with this is : it call the same 
//function again and again for the same value
//time complexity for this is O(2^n) which is
//not good
recurssive function to find fibonacci series
the problem with this is : it call the same
function again and again for the same value
time complexity for this is O(2^n) which is
not good
recurssive function to find fibonacci series the problem with this is : it call the same function again and again for the same value time complexity for this is O ( 2^n ) which is not good
int fib_rec(int n)
{
    if(n<=1)
    {
        return n;
    }
    return fib_rec(n-2)+fib_rec(n-1);
}
int fib_rec ( int n ) { if ( n <= 1 ) { return n ; } return fib_rec ( n - 2 ) + fib_rec ( n - 1 ) ; }
recurssive function to find fibonacci series
the problem with this is : it call the same
function again and again for the same value
time complexity for this is O(2^n) which is
not good
recurssive function to find fibonacci series the problem with this is : it call the same function again and again for the same value time complexity for this is O ( 2^n ) which is not good