subject

Tasks

//Written in Java

This assignment has three parts:

Create two identical integer arrays with 10,000 elements.
Bubble sort an array of 10,000 elements linearly.
Bubble sort an array of 10,000 elements in parallel.
Task 1 – Create the Arrays

The first step is to create two completely identical arrays with 10,000 integers in each of them. Create one array using random values. Any values from the smallest integer possible to the largest is fine. Then create another array by performing a deep copy. They must be two distinct objects, DO NOT perform a shallow copy.

Task 2 – Linear Bubble Sort

Using one of the arrays previously created, use the bubble sort algorithm to sort it. Do so in a linear fashion. This can be done simply by using a few loops, as it was introduced in 1321L. Make sure to time the program as it performs the bubble sort.

Task 3 – Parallel Bubble Sort

Use the other array and perform a bubble sort on it, but this time in parallel. This can be done in many ways, but all make use of some parallel code implemented in the standard library. You may use any method of parallelism. Make sure to time the program as it performs the bubble sort.

Print out the time it takes to perform both methods of sorting. Make sure that enough decimal places are included to show a difference in performance between the two.

βˆƒ Some Sample Output:

Finished creating identical arrays.

Starting linear bubble sort, please wait...

Finished linear bubble sort.

Starting parallel bubble sort, please wait...

Finished parallel bubble sort.

Time for linear bubble sort: 0.0001274 seconds

Time for parallel bubble sort: 0.0000512 seconds

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:30
Which cultural aspect does this type of song best portray? a german polka dance
Answers: 1
question
Computers and Technology, 23.06.2019 07:10
If you want to import a picture into a dtp application, what must you do first? draw an image frame. import text. open the folder containing the file. select get image… from the windows menu.
Answers: 2
question
Computers and Technology, 23.06.2019 22:30
Apart from confidential information, what other information does nda to outline? ndas not only outline confidential information, but they also enable you to outline .
Answers: 1
question
Computers and Technology, 24.06.2019 09:30
What is the definition of digital literacy?
Answers: 1
You know the right answer?
Tasks

//Written in Java

This assignment has three parts:

Crea...
Questions
question
Biology, 23.08.2019 09:30
question
History, 23.08.2019 09:30
question
Social Studies, 23.08.2019 09:30