Please, provide code examples in a language of your choice.
Update: No constraints set on external storage.
Example: Integers are received/sent via network. There is a sufficient space on local disk for intermediate results.
Sorting a million 32-bit integers in 2MB of RAM using Python by Guido van Rossum