Give a divide and conquer algorithm for the same problem


Suppose you are asked to compute the value of b^n for n, a large nonnegative integer. The simple solution is to compute the product b x b x ... x b involved n - 1 multiples. This takes time theta(n).

Give a divide and conquer algorithm for the same problem that takes time theta(log(n)). you should state that the algorithm using pseudo-code. Follow this with a short analysis to show that you have achieved theta(log(n)) time.

Note: Your pseudo-code will be using "standard" multiples (i.e. you are not trying to make the simple multiply of two numbers any faster).

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Give a divide and conquer algorithm for the same problem
Reference No:- TGS01254890

Now Priced at $20 (50% Discount)

Recommended (98%)

Rated (4.3/5)