Sorting Integers and Rational Numbers