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
  • 39,719
  • 12
  • 74
  • 101

0 Answers0