Java List Median median(List data)

Here you can find the source of median(List data)

Description

median

License

Open Source License

Declaration

public static <T> T median(List<T> data) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Collections;
import java.util.List;

public class Main {
    public static <T> T median(List<T> data) {
        Collections.sort((List) data);
        int n = data.size();
        return data.get(n / 2);
    }//from w ww  .j  a va  2  s . co  m
}

Related

  1. median(List list)
  2. median(List list)
  3. median(List p)
  4. median(List sortedDataAscendingOrder)
  5. median(List list)
  6. median(List data)
  7. medianAbsVal(List vals)
  8. medianAbsValAboveThresh(List vals, double thresh)
  9. medianDouble(List vals)