Try to sort array or vector more efficiently.