Sorts the array a in non-decreasing order. Ensure that the sorted elements make up the same set of elements as the original.