public class FastMedian extends Object
Constructor and Description |
---|
FastMedian() |
Modifier and Type | Method and Description |
---|---|
static float |
getMedian(float[] arr,
int n)
Calculates the median of the array.
|
static float |
getMedianUnmanaged(float[] arr,
int n)
Returns median of the array.
|
public FastMedian()
public static float getMedianUnmanaged(float[] arr, int n)
This Quickselect routine is based on the algorithm described in "Numerical recipes in C", Second Edition, Cambridge University Press, 1992, Section 8.5, ISBN 0-521-43108-5
This code by Nicolas Devillard - 1998. Public domain.
arr
- the arrayn
- length of arraypublic static float getMedian(float[] arr, int n)
arr
- the arrayn
- length of array