Wednesday, August 25, 2010

CS Homework (Primitive Operations)

public static int Fib(int x){
if (x == 2){
return 1;
}
if(x == 1){
return 1;
}

return fib(x-1) + fib(x-2);
}

Asked: number of primitive operations used.

No comments:

Post a Comment

Include your name, please.