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, 21.06.2019 17:10
Type the correct answer in the box. spell all words correctly. which technology should andrea use? andrea owns a potato chips manufacturing unit. she has been getting complaints about the quality of the chips. she knows her product is good. she realizes that she needs to change the way the chips are packaged. she should use technology, which uses gases, such as carbon dioxide or argon, to create an air cushion, which improves the shelf life of products.
Answers: 2
question
Computers and Technology, 21.06.2019 22:00
Which is produced by the endocrine system to control how cells and organs function
Answers: 2
question
Computers and Technology, 22.06.2019 23:00
In which part of a professional email should you try to be brief, but highly descriptive?
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
An english teacher would like to divide 8 boys and 10 girls into groups, each with the same combination of boys and girls and nobody left out. what is the greatest number of groups that can be formed?
Answers: 2
You know the right answer?
Tasks

//Written in Java

This assignment has three parts:

Crea...
Questions
question
Mathematics, 31.01.2020 17:43
question
Mathematics, 31.01.2020 17:43
Questions on the website: 13722361