It is possible to find a n-th power much quicker than by making n multiplications!
To do this you need to use the following recurrence relations:
for even n,
for odd n.
Implement the algorithm of quick exponentiating using a recursion method.
It is possible to find a n-th power much quicker than by making n multiplications!
To do this you need to use the following recurrence relations:
for even n,
for odd n.
Implement the algorithm of quick exponentiating using a recursion method.
Sample Input 1:
2.0
1Sample Output 1:
2.0Sample Input 2:
1.5
10Sample Output 2:
57.665Create a free account to access the full topic