title: running time of longest non-decreasing segment in an array
body: <p>I have a method in java that finds the longest non-decreasing segment in an array.
  The method works, however, as part of the assignment, I need to find the running time of size n elements using the method in terms of O(f(n))(i.e upper bound) and Ω(g(n))(i.e lower bound). Can someone help me?
  thanks in advance!!</p>
  
  <pre><code>    public int maxAscent(int A[])
      {
  int num = 0;
  int count = 1;
  int i;
  for(i = 0; i &lt; A.length-1; i++)
      if(A[i] &lt;= A[i+1])
          count++;
      else
      {
          if(count &gt; num)
              num = count;
          count = 1;
      }
  if(count &gt; num)
      num = count;
  return num;
  </code></pre>
  
  <p>}</p>