Java mean meanArithmetic(LinkedList a)

Here you can find the source of meanArithmetic(LinkedList a)

Description

mean Arithmetic

License

Open Source License

Declaration

public static double meanArithmetic(LinkedList<Double> a) 

Method Source Code

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

import java.util.*;

public class Main {
    public static double meanArithmetic(LinkedList<Double> a) {
        int n = a.size();
        double sum = 0.0;
        for (int i = 0; i < a.size(); i++) {
            sum = sum + a.get(i);/*from   w w  w.  j  ava 2  s.  co  m*/
        }
        return sum / n;
    }
}

Related

  1. Mean(Object in)
  2. mean_Integer(List values)
  3. meanAbortedExecutionTime( double totalExecutionTime, int totalOps, double granuleAbortProb)
  4. meanAndStandardDeviation(final double[] inp, final int startIndex, final int pastEnd)
  5. meanAndVariance(double[] a, boolean useUnbiasedEstimate)
  6. meanArray(double[] arr)
  7. meandiff(double[] v1, double[] v2)
  8. meanEnt(double[] nums)
  9. meanFast(final double[] values)