This is an old revision of the document!
High risk of freezing your computer. Show the assistant your progress before starting this exercise!
[5p] TASK A - Generating a script
Good to know:
Split the file into smaller chunks that would fit in memory (e.g. 200MB).
Use a classical sort algorithm for sorting these chunks.
Merge the sorted chunks two by two. Read in memory only two numbers at a time (one from each chunk) starting from the beginning, compare the numbers, write the smallest in the merged file, and read the next number from the chunk that had its number written in the merged file.
Repeat the last step until you obtain the original file sorted.