Question: Ex . 2 ( a , but done fast ) Suppose you want to calculate the n ^ ( th ) power of a
Exa but done fast Suppose you want to calculate the n th power of a given number a Suppose you know a fix it say to but is an input Perhaps the first thing you would do is to compute a times a times a etc. for n times. How much time would you spend in this case? we assume multiplying and addition takes constant time Can we do better? If yes, how If not, why not? hint: divide and conquer
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
