landonreed1834 landonreed1834
  • 22-02-2024
  • Computers and Technology
contestada

what will be the time complexity of the following code?
int xpowy(int x, int n)
{
if (n==0)
return 1;
if (n==1)
return x;
if ((n ) == 0)
return xpowy(x*x, n/2);
else
return xpowy(x*x, n/2) * x;
}
a. ( logn)
b. (n)
c. (nlogn)
d. (n∗n)

Respuesta :

Otras preguntas

Which of the following policies was enforced by creating a series of alliances to limit the spread of communism? a. Operation "Rolling Thunder" b. the "Contai
What effect might global warming have on earths inhabitants? Please help!tysm ;)
Why people first created carousels?
Bunyan was in prison for about six months. a. True b. False
An ultrasound system can produce images of body structures because sound waves
About 15 percent of American households have access to the media. TRUE or FALSE
Whenever one house of Congress significantly alters a bill: the bill is nullified. the chief justice determines the constitutionality of the changes. the presid
Explain the metaphor of the compass in donnes a valediction forbidding mourning
Temperature can weather rocks because _____. most rocks do not absorb heat evenly water contracts when it freezes heat can cause minerals to oxidize rocks usual
Multiply 6 ∕5 × 25∕24