✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Considérons l’algorithme suivant pour calculer x^n :
def puissance_rapide(x, n):
if n == 0:
return 1
elif n % 2 == 0:
p = puissance_rapide(x, n/
2)
return p * p
else:
p = puissance_rapide(x, (n
-1)/2)
return x * p * p
Quelle est la complexité temporelle de cette fonction ?
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!