Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

public class MergeSortArraySeq public static void mainString args int array initializeArray100000 long startTime SystemnanoTime sortArrayarray long en... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Java An Introduction To Problem Solving And Programming

Authors: Walter Savitch

8th Edition

0134462033, 978-0134462035

More Books

Students also viewed these Algorithms questions

Question

8.5 What causes a favorable variance?

Answered: 1 week ago