You are viewing a single comment's thread. Return to all comments →
The element at begin(arr) is the first element in the sorted array (see http://www.cplusplus.com/reference/numeric/adjacent_difference/?kw=adjacent_difference for details on how this works). As a result, begin(arr)+1 points to the first absolute difference between two elements.
Seems like cookies are disabled on this browser, please enable them to open this website
Minimum Absolute Difference in an Array
You are viewing a single comment's thread. Return to all comments →
The element at begin(arr) is the first element in the sorted array (see http://www.cplusplus.com/reference/numeric/adjacent_difference/?kw=adjacent_difference for details on how this works). As a result, begin(arr)+1 points to the first absolute difference between two elements.