Implement pow(x,y) in logarithm time

The problem would be straightforward if we are allowed to do it in O(n) time as we can simply multiple x by itself y times. But how to do it in log time?

This is a preview of

pow(x, y) in O(lgn). Read the full post (240 words, estimated 58 secs reading time)