Amazon interview question

Implement Math.pow(a, b) in java.

Interview Answer

Anonymous

Sep 23, 2015

1. Use recursion, be careful of edge cases with negatives and 0. 2. Improve efficiency by using properties of powers

6