Find all pairs in an array whose absolute difference equals x
I don't have the rep to comment, and I know you said without sorting first, but if you are already at worst case performance of O(n^2), and sorting in theory is O(nlogn), why not then sort if it wont hurt your big-o performance? 

i.e.

A.sortAscending() // however done in java. in theory is O(nlogn)

int j = 0;
for (int i = j; i &lt; A.len; i++) {
    while (j &lt; A.len &amp;&amp; (abs(A[i] - A[j++]) &lt; x))
        ; // do nothing

    // so now we are guarenteed absdiff(arr[i], arr[j]) &lt;= x.
    // as soon as it != x we can move on because as the array is sorted
    // the difference will only increase, thus not equaling x again
    while (j &lt; A.len &amp;&amp; (abs(A[i] - A[j++]) == x))
        resultArray.add((arr[i], arr[j])
}