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

<br>
<br>

<i>Runtime: </i> O(n)

@param shortArray the short array to check

@return <i>true</i> if the short array is sorted, else <i>false</i>.