title: 2D Greedy Ascent Search Algorithm Clarification
body: <p>I am doing some remedial work on algorithms as I am taking a graduate course on them in the Fall and was a physics undergrad. Watching this <a href="https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-006-introduction-to-algorithms-fall-2011/lecture-videos/lecture-1-algorithmic-thinking-peak-finding/" rel="nofollow noreferrer">video</a> and at the 38:00 mark he goes over the greedy ascent algorithm for a 2D array. I am confused as he defines the peak as 
  a &lt;= b,c,d,e (with b,c,d and e being the elements to the left,right,top,bottom of the current element 'a'). And then he goes on to say that to find the peak you follow the greatest element bordering on 'a' but what if you have the 2D array:</p>
  
  <p>20 15 13<br>
  12  10 10<br>
  40 40 40</p>
  
  <p>and started at 13, wouldn't the greedy ascent algorithm incorrectly identify 20 as the peak? How can you search an unsorted array without having to look at every element?</p>
  
  <p>I thank you for your help apologize in advance if this is a silly question.</p>