title: Simple "maximum value in array" and complexity calculations
body: <p>I'm pretty new to this stuff and I need your help.</p>
  
  <p>I should build an efficient simple algorithm which returns the maximum value in an array with size of n which contains the numbers 1,2,...n with repetitions.</p>
  
  <p>Then I have to determine the best running time, average running time and worst running time.</p>
  
  <p>So I have two questions:</p>
  
  <ol>
  <li><p>First of all I'm trying to understand what's the idea of requiring an efficient solution for  this simple algorithm. As far as I understand I should only have a simple loop from 1 to n and look for the maximum value. Is the "efficient" algorithm points out that If I find the value n in the array I can stop searching more values because this is the maximum value in the array?</p></li>
  <li><p>How do I determine the best running time and average running time using the fact, while calculating the average running time, that It's a uniform distribution.
  That is, each cell in the array has a chance of 1/n to be the maximum value.</p></li>
  </ol>
  
  <p>Thanks a lot in advance!</p>