Tag Archives: recursion

RECURSION

int rabbit(int n)
if (n==1) return 1;
else if (n==2) return 2;
else return rabbit(n-1)+rabbit(n-2)

All recursive solutions can be stated in iterative terms (loops)

Leave a Comment

Filed under CSE 130