Trace externalMergesortwith an external file of 16 blocks. Assume that thearrays in1, in2, and outare each one block long. List the calls to the various functions in theorder in which they occur.
What will be an ideal response?
```
externalMergesort(unsortedFileName, sortedFileName)
// This call to externalMergesort results in the following actions:
Associate unsortedFileName with the file variableinFile
Associate sortedFileName with the file variable outFile
blocksort(inFile, tempFile1, numBlocks)
// Records in each block are now sorted; numBlocksis 16
mergeFile(tempFile1, tempFile2, 1, 16)
// This call to mergeFile makes the following calls tomergeRuns:
mergeRuns(tempFile1, tempFile2, 1, 1)
mergeRuns(tempFile1, tempFile2, 3, 1)
mergeRuns(tempFile1, tempFile2, 5, 1)
mergeRuns(tempFile1, tempFile2, 7, 1)
mergeRuns(tempFile1, tempFile2, 9, 1)
mergeRuns(tempFile1, tempFile2, 11, 1)
mergeRuns(tempFile1, tempFile2, 13, 1)
mergeRuns(tempFile1, tempFile2, 15, 1)
mergeFile(tempFile2, tempFile1, 2, 16)
// This call to mergeFile makes the following calls tomergeRuns:
mergeRuns(tempFile2, tempFile1, 1, 2)
mergeRuns(tempFile2, tempFile1, 5, 2)
mergeRuns(tempFile2, tempFile1, 9, 2)
mergeRuns(tempFile2, tempFile1, 13, 2)
mergeFile(tempFile1, tempFile2, 4, 16)
// This call to mergeFile makes the following calls tomergeRuns:
mergeRuns(tempFile1, tempFile2, 1, 4)
mergeRuns(tempFile1, tempFile2, 9, 4)
mergeFile(tempFile2, tempFile1, 8, 16)
// This call to mergeFile makes the following calls tomergeRuns:
mergeRuns(tempFile2, tempFile1, 1, 8)
copyFile(tempFile1, outFile)
```
You might also like to view...
Importing style sheets and image files into your site embeds them into the site folder.
Answer the following statement true (T) or false (F)
Click Mark to mark every instance of selected text for inclusion in the index.
Answer the following statement true (T) or false (F)