I have seen this question on here however the answers are not
very clear can somone...
You need to sort a file of n Gigabytes stored on a hard-drive. Your RAM contains only 5GB. You have a lighting-fast CPU, but writing or reading from the disk (a single 1/0 operation) is slow. So we estimate the number of I/O operations, and ignore CPU time. For simplicity, assume your disk is partitioned into blocks, each of size 1GB. In each 1/0 operation, you could read or write one single block. The input file occupied the blocks bi... bn. Explain how to sort the file, using O{n log n) 1/0 operations. No Spacing You could assume that your hard-drive contains n blocks of free space f1, f2 fr. Ignore caching issues. After the sorting is executed, the smallest key of the file is at bì, the largest at block bn, every keys of block bị is smaller than every key at block bi+1 etc. (b) Next repeat this question, but with all the following modifications: i. The worst case number of I/O operations is O(n). ii. The expected running time is O(n log n) iii. Your hard drive is full. There are no free blocks