These algorithms are mostly from Standish, T. (1995), Data Structures, Algorithms & Software Principles in C. Power1 - contains a recursive method that computes x^n, called power(x, n), where x is a floating point number and n is a nonnegative integer. The algorithm is naturally recursive, and O(n). Base cases: power(x, 0) = 1.0 power(x, 1) = x General case: power(x, n) = x * power(x, n-1), for n > 1 Power2 - an improved recursive version of power(x, n) works by breaking n down into halves (where half of n = n / 2), squaring power(x, n / 2), and multiplying by x again if n was odd. For example, x^11 = (x^5) * (x^5) * x, whereas x^10 = (x^5) * (x^5). This algorithm is O(log n). Here are some sample runs, using our Power2 solution: % java Power1 1.2 50 1.2 to the power of 50 is 9100.438150002134 (power called 50 times) % java Power2 1.2 50 1.2 to the power of 50 is 9100.438150002139 (power called 6 times) % java Power2 -3 7 -3.0 to the power of 7 is -2187.0 (power called 3 times) % java Power1 2 arguments required % java Power2 1.2 2 arguments required % java Power1 3 -2 power must be positive