Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static boolean isSorted(Comparable[] toComp) {
- for (int i = 0; i < toComp.length - 1; i++) {
- if (toComp[i].compareTo(toComp[i + 1]) > 0) {
- return false;
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement