title: Find adjacent elements in a 2D matrix
body: <p>I have a 2 dimensional matrix of order m *n</p>
  
  <pre><code>00 01 02 03 ....0n
  10 11 12 13 ....1n
  20 21 22 23 ....2n
  ..
  m0 m1 m2  m3 ...mn
  </code></pre>
  
  <p>From this, given an element , i need to write a method that returns its adjacent elements.
  Adjacent elements are either horizontally, vertically, or diagonally adjacent.</p>
  
  <p>For example, adjacent element of 01 is 00,02,10,11,12
  adjacent element of 00 is 01 ,10,11
  adjacent element of 11 is 00,01,02,10,12,20,21,22</p>
  
  <p>Can some one help me with an optimistic algorithm to solve this?</p>