Advertisement
Guest User

Untitled

a guest
Oct 13th, 2013
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.26 KB | None | 0 0
  1.     public static boolean isSorted(Comparable[] toComp) {
  2.         for (int i = 0; i < toComp.length - 1; i++) {
  3.             if (toComp[i].compareTo(toComp[i + 1]) > 0) {
  4.                         return false;
  5.             }
  6.         }
  7.         return true;
  8.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement