1
public static int f(int a){
        if(a==0) return 0;
        if(a==1) return 1;
        return (f(a-1) + f(a-2));
}

Is there a non-recursive way of doing this?

Subhrajyoti Majumder
  • 40,646
  • 13
  • 77
  • 103

0 Answers0