Question: In Java. Use Multithreaded Programming to implement Merge Sort. The input data are stored in a file with name input.txt (elements in the files are

In Java. Use Multithreaded Programming to implement Merge Sort. The input data are stored in a file with name input.txt (elements in the files are all integers, and in total there are 1 million integers in the file). Assume your computer has 4 cores, and the memory space is not big enough to load the whole file. Write the final sorting result to file result.txt. When you implement the merge sort, you optimization goal is sorting performance.

Hint: split the original into 4 smaller files. Use 4 threads to sort each file and then merge all files (you need two merging phases) to generate the final result.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!