Question: Write a java static method named isSorted with a boolean return type. The method should accept an array of ints as an argument. It should
Write a java static method named isSorted with a boolean return type. The method should accept an array of ints as an argument. It should return true if the array is sorted, and false if it is not. Keep in mind that the array might be sorted in ascending (elements get larger) order, or descending order (elements get smaller). Your method should return true in either of those cases, and otherwise false.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
