mam, either apply merge sort or heap sort.. both will give $O(nlgn) $ running time in worst case whereas worst case running time of quick sort is $O(n^2).$
Here, We have to find a pair of elements whose absolute difference is minimum.
1) First sort the elements in O(nlgn) time.
2) scan the whole array and check the absolute difference between each pair of elements. So, comparison should be like this A with A then A with A and so on. We are doing like this because if elements are sorted then only adjacent will give least difference if we scan array from left to right and elements are sorted in non-decreasing order.
This whole process of scanning takes O(n) time to find the least difference pair of elements.
So, Total running time will be O(nlgn +n) =(nlgn)