What does the following function compute in terms of $n$ and $d$, for integer values of $d$ ? Note that the operation $/$ denotes floating point division, even if the arguments are both integers.
function foo(n,d){
if (d == 0){
return 1;
}else{
if (d < 0){
return foo(n,d+1)/n;
}else{
return n*foo(n,d-1);
}}}
- $log_dn$ if $d < 0$ , $n^d\ $if$ \ d>0$.
- $n^d$ for all the values of $d$.
- $n \times d$ if $d>0$ ,$n\div d$ if $d<0$.
- $n \times d$ for all the values of $d$.