Answers for "check if string array is sorted"

2

check array is sorted java

boolean isSorted(int[] array) {
    for (int i = 0; i < array.length - 1; i++) {
        if (array[i] > array[i + 1])
            return false;
    }
    return true;
}
Posted by: Guest on October-05-2021

Code answers related to "check if string array is sorted"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language