title: Array "maximum difference" algorithm that runs in O(n)?
body: <p>Given an array of N integers, sort the array, and find the 2 consecutive numbers in the sorted array with the maximum difference.</p>
  
  <p>Example – on input <code>[1,7,3,2]</code> output <code>4</code> (the sorted array is <code>[1,2,3,7]</code>, and the maximum difference is 7-3=4).</p>
  
  <p>Algorithm A runs in <code>O(NlogN)</code> time.</p>
  
  <p>I need to find an algorithm identical in function to algorithm A, that runs in O(N) time.</p>