I'm trying to call a method that prints the first and third quartiles of a data set (array of doubles), and to do that it needs to check whether or not the array of doubles has been sorted (using Array.sort() ). To check if the array has been sorted, I use static boolean isSorted(double data).
static boolean isSorted(double data)
int biggerCount = 0;
for(int m = 0; m<data.length;m++)
if(data[m] != Math.min(data[m], data[m+1]) )
if(biggerCount == 0)
On the line containing the if-statement, I get the ArrayIndexOutOfBoundsException, when running the driver program. Any ideas as to how to fix this?