Class Power

java.lang.Object
com.zybooks.dsaj.recursion.Power

public class Power extends Object
Demonstration of the more efficient method for computing the power function.
  • Constructor Details

    • Power

      public Power()
  • Method Details

    • power

      public static double power(double x, int n)
      Computes the value of x raised to the nth power, for nonnegative integer n.
    • main

      public static void main(String[] args)