Section 8.5.1 suggests that an easy modification to the basic 2-way mergesort is to read in a

Question:

Section 8.5.1 suggests that an easy modification to the basic 2-way mergesort is to read in a large chunk of data into main memory, sort it with quicksort, and write it out for initial runs. 

8.5.1 Simple Approaches to External Sorting If your operating system supports virtual memory, the simplest

Our approach to external sorting is derived from the Mergesort algorithm. The simplest form of external

36 17 28 23 20 13 14 15 Runs of length 1 20 36 14 28 13 17 15 23 Runs of length 2 13 17 20 36 14 15 23 28

Then, a standard 2-way merge is used in a series of passes to merge the runs together. However, this makes use of only two blocks of working memory at a time. Each block read is essentially random access, because the various files are read in an unknown order, even though each of the input and output files is processed sequentially on each pass. A possible improvement would be, on the merge passes, to divide working memory into four equal sections. One section is allocated to each of the two input files and two output files. All reads during merge passes would be in full sections, rather than single blocks. While the total number of blocks read and written would be the same as a regular 2-way mergsort, it is possible that this would speed processing because a series of blocks that are logically adjacent in the various input and output files would be read/written each time. Implement this variation, and compare its running time against a standard series of 2-way merge passes that read/write only a single block at a time. Before beginning implementation, write down your hypothesis on how the running time will be affected by this change. After implementing, did you find that this change has any meaningful effect on performance?

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: