title: Complexity in cases excellent, average and bad
body: <p>I created this method in java that indicates whether an integer array is sorted or not. What is its complexity? I think if good is O(1) in the worst case is O(n) in the average case?</p>
  
  <pre><code>static boolean order(int[] a){
    for(int i=0;i&lt;a.length-1;i++){
      if(a[i]&gt;a[i+1]) return false;
    }
   return true;
  }
  </code></pre>