下面代码实现了计算 的快速幂算法,该算法体现的编程思想是( )。
def power(x, n): if n == 0: return 1 res = power(x, n // 2) if n % 2 == 0: return res * res else: return res * res * x下面代码实现了计算 的快速幂算法,该算法体现的编程思想是( )。
def power(x, n): if n == 0: return 1 res = power(x, n // 2) if n % 2 == 0: return res * res else: return res * res * x