An algorithmic exercise. Sorts a list using a given set or elementary operations