Sort:  

You can also implement this method in MATLAB and in R.