public static boolean isReverseSorted ( int [ ] intArray ) { for ( int i = 0 ; i < intArray . length - 1 ; i ++ ) { if ( intArray [ i ] < intArray [ i + 1 ] ) { return false ; } } return true ; }
Check if the integer array is reverse sorted . It loops through the entire integer array once checking that the elements are reverse sorted .