Computers and Technology

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

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 15:00, cooljariel11
What questions about an audience should be asked during presentation preparation? check all that apply. what does the audience already know about the topic? how will multimedia tools inspire the audience? is the information interesting and engaging? how will this information affect the presentation? will the audience change the message’s purpose? what is likely to interest the audience?
Answers: 3
image
Computers and Technology, 25.06.2019 04:20, mjam85877
Many prestigious universities have a system called a “legacy preference system” which is used to decide which applicants should be accepted to the university. if an applicant’s parent is an alumnus of the university, the applicant will be admitted with lower gpa and sat scores than if the parent is not an alumnus. (there is currently a lot of discussion about the fairness of this system, but universities get a lot of money from their alumni so they are unwilling to change ) your assignment for mp2 is to implement a computerized system like this for a very small prestigious university. the university has two schools, liberal arts and music, each with their own criteria for accepting students. your program must read in certain information about an applicant and print a message saying whether the applicant should be accepted or not.
Answers: 2
image
Computers and Technology, 26.06.2019 08:50, Dianar8407
Write smallest to largest: byte, bit, mb, pb, gb, nibble
Answers: 3
image
Computers and Technology, 26.06.2019 14:00, jm00120
"a switch passes data based on the mac address."a. trueb. false
Answers: 1
Do you know the correct answer?
Tasks

//Written in Java

This assignment has three parts:

Crea...

Questions in other subjects:

Konu
Mathematics, 02.02.2021 23:20
Konu
Mathematics, 02.02.2021 23:20
Konu
Mathematics, 02.02.2021 23:20
Konu
Mathematics, 02.02.2021 23:20