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.
c program to calculate power of a number using recursion
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.