I\'m having trouble writing a method that returns true if the elements of an array (numbers) are in sorted order, ascending or descending, and false, if they are not in any
public static boolean checkSortedness(final int[] data) { for (int i = 1; i < data.length; i++) { if (data[i-1] > data[i]) { return false; } } return true; }