Answer:
Part a: For optimal 4-way merging, initiate with one dummy run of size 0 and merge this with the 3 smallest runs. Than merge the result to the remaining 3 runs to get a merged run of length 6000 records.
Part b: The optimal 4-way merging takes about 249 seconds.
Explanation:
The complete question is missing while searching for the question online, a similar question is found which is solved as below:
Part a
<em>For optimal 4-way merging, we need one dummy run with size 0.</em>
- Merge 4 runs with size 0, 500, 800, and 1000 to produce a run with a run length of 2300. The new run length is calculated as follows
- Merge the run as made in step 1 with the remaining 3 runs bearing length 1000, 1200, 1500. The merged run length is 6000 and is calculated as follows
<em>The resulting run has length 6000 records</em>.
Part b
<u><em>For step 1</em></u>
Input Output Time
Input Output Time is given as
Here
- L_run is 2300 for step 01
- Size_block is 100 as given
- Time_{I/O per block} is 2 sec
So
So the input/output time is 46 seconds for step 01.
CPU Time
CPU Time is given as
Here
- L_run is 2300 for step 01
- Size_block is 100 as given
- Time_{CPU per block} is 1 sec
So
So the CPU time is 23 seconds for step 01.
Total time in step 01
Total time in step 01 is 69 seconds.
<u><em>For step 2</em></u>
Input Output Time
Input Output Time is given as
Here
- L_run is 6000 for step 02
- Size_block is 100 as given
- Time_{I/O per block} is 2 sec
So
So the input/output time is 120 seconds for step 02.
CPU Time
CPU Time is given as
Here
- L_run is 6000 for step 02
- Size_block is 100 as given
- Time_{CPU per block} is 1 sec
So
So the CPU time is 60 seconds for step 02.
Total time in step 02
Total time in step 02 is 180 seconds
Merging Time (Total)
<em>Now the total time for merging is given as </em>
Total time in merging is 249 seconds seconds