单选题

Consider the following definition of a recursive function, power, that will perform exponentiation.Asymptotically (渐进地) in terms of the exponent e, the number of calls to power that occur as a result of the call power(b, e) is?

发布于 2022-03-03 11:06:28

Consider the following definition of a recursive function, power, that will perform exponentiation.
int power(int b, int e) { 
    if (e == 0) 
        return 1 
    if (e %2 == 0) 
        return power (b * b, e / 2) 
    return b * power(b * b, e / 2) 
}
Asymptotically (渐进地) in terms of the exponent e, the number of calls to power that occur as a result of the call power(b, e) is

登录后免费查看答案
关注者
0
被浏览
19
知识点
面圈网VIP题库

面圈网VIP题库全新上线,海量真题题库资源。 90大类考试,超10万份考试真题开放下载啦

去下载看看