Proving an algorithm wrong So I have this algorithm that outputs the largest value of an array: 


Input: $A[1,\dots,n]$, $n\geq 1$
Output: Largest value of an array




Maximum (A)
  m = A[1] 
  i = 1 
  while i &lt; n
    if A[i+1] &gt; A[i]
      m = A[i+1]
    i = i+1
  return m


I have to prove this algorithm wrong and I'm confused how to do that, because to me the algorithm seems correct. Any advice on how to do this are very much appreciated.
Consider the input $100,0,1$.

As a follow-up, identify the bug, and correct the algorithm.