Package com.zybooks.dsaj.primer
Class ArrayMax
java.lang.Object
com.zybooks.dsaj.primer.ArrayMax
Demonstration of a recursive method to find the maximum value in an array.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
max
(double[] data) Returns the maximum value within a nonempty array of doubles.
-
Constructor Details
-
ArrayMax
public ArrayMax()
-
-
Method Details
-
max
public static double max(double[] data) Returns the maximum value within a nonempty array of doubles.- Parameters:
data
- a nonempty array of numeric values- Returns:
- the maximum value among the data
-