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