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)

```

Computer Science & Information Technology

You might also like to view...

Which of the following statements is false?

a. By convention class names begin with an uppercase letter, and method and variable names begin with a lowercase letter. b. Instance variables exist before methods are called on an object, while the methods are executing and after the methods complete execution. c. A class normally contains one or more methods that manipulate the instance variables that belong to particular objects of the class. d. Instance variables can be declared anywhere inside a class.

Computer Science & Information Technology

To make a Flash video available to older browsers, you use theobjectand __________ elements.

A. param B. flash C. source D. embed

Computer Science & Information Technology

Explain what happens if you upsize a database containing multivalued fields to SQL Server.

What will be an ideal response?

Computer Science & Information Technology

Microsoft ________ is a cloud storage and file sharing service.

A. iCloud B. Dropbox C. OneDrive D. Drive

Computer Science & Information Technology