Question: Divide and conquer Write a function to calculate ( a raised to the power of b ) using a divide - and - conquer approach.
Divide and conquer
Write a function to calculate a raised to the power of b using a divideand
conquer approach. The function should handle both positive and negative integer
values of b as well as edge cases where a is The goal is to achieve a time
complexity of or better ideally lg
Requirements:
a can be any integer positive negative, or zero
b can be any integer positive negative, or zero
If and return an error message.
Write the pseudocode for your algorithm and specify its time complexity BigO
notation
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
