Question: Explain how divide and conquer strategy can be used to calculate power of a number in O(log(n)) time. Example, power(5,2) = 25, power(2,7) = 128.
Explain how divide and conquer strategy can be used to calculate power of a number in O(log(n)) time.
Example, power(5,2) = 25, power(2,7) = 128.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
