开发者

what this function do please ? (java)

    public static int ABC(int x, int y)
{
    if(y==0)
        ret开发者_运维知识库urn(1);
    else
        return(x * ABC(x,y-1));
}

what this function do please ? factorial ?


The x is never changed and multiplied to the 1 exactly y times, as y is decremented in each recursive call until it is 0. So the function computes x^y in a recursive way.


Looks like x ^ y

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜