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 08:30
1.the index finger on your right hand types the f r v 4 j u m 7 h y 6 n lo.9 j u 7 m g t 5 b 2.if you need to multiply 400, 2, and 1 ½, what would you type on the numeric keypad? 400*2*1.5 400/2*1.5 400/2/1.5 400*2*1½ 3.select all examples of proper keyboarding technique. rest your fingers gently on the home row or home keys. slouch in your chair. rest your palms on the keyboard. relax your fingers. keep your hands lower than your elbows.
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
Who can provide you with a new password when you have forgotten your old one? your provide you with a new password in case you forget your old one.
Answers: 3
question
Computers and Technology, 23.06.2019 06:30
To become an audio technician, the most successful tactics might include the following. (select all that apply). learning how to persuade other people gaining different types of experience in audio technology learning as much as possible about art history establishing a reputation as a reliable professional
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
In the context of the box model, what is the difference between a margin and a padding? a. a padding lies outside a box border, while a margin lies inside it. b. a padding lies inside a box border, while a margin lies outside it. c. a padding can be adjusted independently, while a margin depends on the size of its box. d. a padding depends on the size of its box, while a margin can be adjusted independently.
Answers: 3
You know the right answer?
Tasks

//Written in Java

This assignment has three parts:

Crea...
Questions
Questions on the website: 13722362