Topic: Data Stream Problem
A network streams to you 100 Mega Bytes of data at a time. In all, you will receive a total of 800 Mega Bytes. I.e. you are to receive a total of 8 such blocks, each 100 Mega Byte in size. However, you donot know when each block will arrive though the total time is bounded. Our total time bound is thirty minutes. I.e. all the 8 blocks will arrive within thirty minutes.
Your main memory(RAM) is limited to 100 Mega Byte though you have unlimited(enough) hard disk space. Give an efficient algorithm to sort the entire 800 Megabyte of data as quick as possible(think hard real time constraints).
Note: You can assume that each element that is to be sorted is of positive integer of length 128 bits.
Edit: Now consider another scenario. Say, that you have all the 8 blocks(i.e the entire 800 Mega Bytes) on your hard disk. Would you use the same strategy as you used for the earlier case to sort it time efficiently or would you go for a new strategy? Explain.