SHARE
TWEET

Untitled

a guest Jan 16th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     public static double[] getMaxArray1(double[] inputArray)
  2.     {
  3.         double[] maxArray = new double[inputArray.length];
  4.         double max = inputArray[0];
  5.         int count = 1;
  6.        
  7.         for(int i = 0; i < inputArray.length; i++)
  8.         {
  9.             if(inputArray[i] > max)
  10.             {
  11.                 max = inputArray[i];
  12.                 count = 1;
  13.                 maxArray[0] = max;
  14.             }
  15.             else if(max == inputArray[i])
  16.             {
  17.                 maxArray[count] = max;
  18.                 count++;
  19.             }
  20.         }
  21.        
  22.         return maxArray;
  23.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top