Java Array Max Value maxcount(int[] vals, int max, int maxcount)

Here you can find the source of maxcount(int[] vals, int max, int maxcount)

Description

maxcount

License

Open Source License

Declaration

private static int maxcount(int[] vals, int max, int maxcount) 

Method Source Code

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

public class Main {
    private static int maxcount(int[] vals, int max, int maxcount) {
        for (int i = 0; i < vals.length; i++) {
            int v = vals[i];
            if (v > max) {
                max = v;// w  w w. j  a  va  2s  . c om
                maxcount = 1;
            } else if (v == max) {
                maxcount++;
            }
        }
        return maxcount;
    }
}

Related

  1. maxArray(int[] arr)
  2. maxBetween(int[] arr1, int[] arr2)
  3. maxbits(int[] i, int pos, int length)
  4. maxbits32(int[] i, int pos)
  5. maxCommonLeadingWhitespaceForAll(String[] strings)
  6. maxDblArrayValue(int npts, double[] dbls)
  7. maxdex(float... values)
  8. maxdiffbits(int initoffset, int[] i, int pos, int length)
  9. maxDiffLocation(double[] list1, double[] list2)