check if array is sorted
In this article, we are going to check if the array is sorted using java. Example:- If arr=[1,2,3,4,5], then the output will be yes. because it is sorted. if arr=[2,4,6,10,8], then the output will be no. because it is not sorted. Steps:- Java code to check if array is sorted or not:- Output:- You can … Read more