Ordering Numbers

Once you can compare two numbers, you can put a whole set of numbers in order. Ordering means arranging them from smallest to largest — called ascending — or from largest to smallest, called descending.

The trick is simple: compare the numbers in pairs to find the smallest one, set it down first, then look for the next smallest from what is left, and keep going. So a jumble like 5,\ 2,\ 9 sorts into:

2 < 5 < 9

Read smallest first, the order is two, five, nine.

Press play. A few numbers appear out of order. We pick the smallest and slide it to its place, then the next, until they sit neatly along the line from small to large. Replay it: each time it shuffles a fresh set of numbers.

Khan Academy works through ordering numbers here: