Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static double[] getMaxArray1(double[] inputArray)
- {
- double[] maxArray = new double[inputArray.length];
- double max = inputArray[0];
- int count = 1;
- for(int i = 0; i < inputArray.length; i++)
- {
- if(inputArray[i] > max)
- {
- max = inputArray[i];
- count = 1;
- maxArray[0] = max;
- }
- else if(max == inputArray[i])
- {
- maxArray[count] = max;
- count++;
- }
- }
- return maxArray;
- }
Add Comment
Please, Sign In to add comment