Question: Write two java programs (sequential and parallel) to implement merge sort that do the following Create a class MergeSortArraySeq that develops a merge sort

Write two java programs (sequential and parallel) to implement merge sort  that do the following     

 Create a class MergeSortArraySeq that develops a merge sort algorithm to sort an array of integer numbers in sequential.  

 MergeSortArrayThread  that will develop merge sort algorithm to sort an array of integer numbers in parallel. 

 Methods to initialize the array with random numbers from 1-N (e.g., N=10,000, N=100,000).  

  Methods to Sort array in sequential/parallel.  

 Compare the time of both algorithms.  

Draw a diagram to show the relationship between execution time in y-axis and the number of threads in x-axis.  (i.e run your program with different number of threads) 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

public class MergeSortArraySeq public static void mainString args int array initializeArray100000 long startTime SystemnanoTime sortArrayarray long en... View full answer

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 Algorithms Questions!