Here you can find the source of sorted(int[] array)
public static boolean sorted(int[] array)
//package com.java2s; //License from project: Open Source License public class Main { public static boolean sorted(int[] array) { int last = array[0], current; for (int i = 0; i < array.length; i++) { current = array[i];/* w w w .ja v a 2s.co m*/ if (last > current) { return false; } last = current; } return true; } }