algorithmlanguage-agnosticgoogle-moderator

How would you sort 1 million 32-bit integers in 2MB of RAM?


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.


Solution

  • Sorting a million 32-bit integers in 2MB of RAM using Python by Guido van Rossum