0
Consider the following pseudo code.
What will the time complexity of function exponentiate() be?
What will the time complexity of function exponentiate() be?
exponentiate(int x, int n)
{
int m=n; power= 1; z= x;
while(m>0)
{
while(m%2 ==0)
{ m= m/2; z= z*z ;
}
m=m-1; power = power*z;
}
return power;
}- A

- B

- C

- D

Correct answer: B