Java Utililty Methods Collection Median

List of utility methods to do Collection Median

Description

The list of methods to do Collection Median are organized into topic(s).

Method

Doublemedian(Collection values)
median
List<Double> filteredValues = filterNulls(values);
if (filteredValues.size() == 0)
    return 0.;
if (filteredValues.size() == 1)
    return filteredValues.get(0);
Collections.sort(filteredValues);
if (filteredValues.size() % 2 == 0) {
    return (filteredValues.get(filteredValues.size() / 2)
...
Tmedian00(Collection coll)
median
if (coll.isEmpty()) {
    return null;
} else {
    List<T> copy = new ArrayList<T>(coll);
    Collections.sort(copy);
    int index = (copy.size() - 1) / 2;
    return copy.get(index);