Write a program to calculate pow(x,n) – Divide and Conquer – Above function can be optimized to O(logn) by calculating power(x, y/2) only once and storing it.
how to calculate power of a number
1 Article
1
Write a program to calculate pow(x,n) – Divide and Conquer – Above function can be optimized to O(logn) by calculating power(x, y/2) only once and storing it.