Pages

Wednesday, October 7, 2009

Fibonacci using normal recursion

Solutions :

int fibo(int n){    // using normal recursion
if(n<2) return (fibo(n-1)+fibo(n-2));
if(n==0) return 0;
else return (1);
}

1 comment:

  1. uses of recursion may cause the time limit exceed in uva judge. Better not to use it directly.

    ReplyDelete