public final class StdStats extends java.lang.Object
For additional documentation, see Section 2.2 of "Introduction to Programming in Java: An Interdisciplinary Approach" by Robert Sedgewick and Kevin Wayne.
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
Test client.
|
static double |
max(double[] a)
Returns the maximum value in the array a[].
|
static double |
max(double[] a,
int lo,
int hi)
Returns the maximum value in the subarray a[lo..hi].
|
static int |
max(int[] a)
Returns the maximum value in the array a[].
|
static double |
mean(double[] a)
Returns the average value in the array a[].
|
static double |
mean(double[] a,
int lo,
int hi)
Returns the average value in the subarray a[lo..hi].
|
static double |
mean(int[] a)
Returns the average value in the array a[].
|
static double |
min(double[] a)
Returns the minimum value in the array a[].
|
static double |
min(double[] a,
int lo,
int hi)
Returns the minimum value in the subarray a[lo..hi].
|
static int |
min(int[] a)
Returns the minimum value in the array a[].
|
static void |
plotBars(double[] a)
Plots bars (i, a[i]) to standard draw,
for i in 0..N-1, where N is the length of a[].
|
static void |
plotLines(double[] a)
Plots line segments connecting points (i, a[i])
to standard draw.
|
static void |
plotPoints(double[] a)
Plots the points (i, a[i]) to standard draw.
|
static double |
stddev(double[] a)
Returns the sample standard deviation in the array a[].
|
static double |
stddev(double[] a,
int lo,
int hi)
Returns the sample standard deviation in the subarray a[lo..hi].
|
static double |
stddev(int[] a)
Returns the sample standard deviation in the array a[].
|
static double |
stddevp(double[] a)
Returns the population standard deviation in the array a[].
|
static double |
stddevp(double[] a,
int lo,
int hi)
Returns the population standard deviation in the subarray a[lo..hi].
|
static double |
sum(double[] a)
Returns the sum of all values in the array a[].
|
static double |
sum(double[] a,
int lo,
int hi)
Returns the sum of all values in the subarray a[lo..hi].
|
static int |
sum(int[] a)
Returns the sum of all values in the array a[].
|
static double |
var(double[] a)
Returns the sample variance in the array a[].
|
static double |
var(double[] a,
int lo,
int hi)
Returns the sample variance in the subarray a[lo..hi].
|
static double |
var(int[] a)
Returns the sample variance in the array a[].
|
static double |
varp(double[] a)
Returns the population variance in the array a[].
|
static double |
varp(double[] a,
int lo,
int hi)
Returns the population variance in the subarray a[lo..hi].
|
public static double max(double[] a)
public static double max(double[] a, int lo, int hi)
public static int max(int[] a)
public static double min(double[] a)
public static double min(double[] a, int lo, int hi)
public static int min(int[] a)
public static double mean(double[] a)
public static double mean(double[] a, int lo, int hi)
public static double mean(int[] a)
public static double var(double[] a)
public static double var(double[] a, int lo, int hi)
public static double var(int[] a)
public static double varp(double[] a)
public static double varp(double[] a, int lo, int hi)
public static double stddev(double[] a)
public static double stddev(double[] a, int lo, int hi)
public static double stddev(int[] a)
public static double stddevp(double[] a)
public static double stddevp(double[] a, int lo, int hi)
public static double sum(double[] a)
public static double sum(double[] a, int lo, int hi)
public static int sum(int[] a)
public static void plotPoints(double[] a)
public static void plotLines(double[] a)
public static void plotBars(double[] a)
public static void main(java.lang.String[] args)