The following algorithm computes \(a^n\).
power(a, n):
if n <- 0:
return 1
else:
m <- n div 2
b <- a * a
if n is even:
return power(b, m)
else:
return power(b, m) * a
Using algorithmic analysis, determine the number of multiplications that this algorithm performs as a function of \(n\). You may find it helpful to restrict your analysis to the cases where \(n\) is a power of \(2\).