Java List Median median(List data)

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

Description

median

License

Apache License

Declaration

@SuppressWarnings({ "rawtypes", "unchecked" })
    public static <Y extends Comparable> Y median(List<Y> data) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Collections;

import java.util.List;

public class Main {
    @SuppressWarnings({ "rawtypes", "unchecked" })
    public static <Y extends Comparable> Y median(List<Y> data) {
        Collections.sort(data);/*  www.ja va  2 s .c o  m*/
        return data.get(data.size() / 2);
    }
}

Related

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