A simple sorting method mentioned in exercise 1.2-1