Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 1 (30 points). Complete the bubbleSort(float[] a) method so that it sorts the specified array a using the bubble sort algorithm. First, for a

Task 1 (30 points). Complete the "bubbleSort(float[] a)" method so that it sorts the specified array "a" using the bubble sort algorithm. First, for a certain time limit that you choose (e.g., 15 minutes), try to implement the "bubbleSort(int[] a)" method based only on your understanding of the algorithm. Please understand that, during each pass, bubble sort examines certain pairs of adjacent elements and swaps two such adjacent elements if they are not in order. Once you finish (or after the time limit), compare your implementation with the Java code in the slides. It is fine to use the code (but some slight changes will be needed). Your code also needs to pass the unit test named "test1()" in "UnitTests.java". Task 2 (30 points). Complete the "selectionSort(float[] a)" method so that it sorts the specified array "a" using the selection sort algorithm. For a certain time limit that you choose (e.g., 15 minutes), try to implement the "selectionSort(float[] a)" method based only on your understanding of the algorithm. Please understand that, during each pass, selection sort finds the largest element within a certain portion in "a" and then swaps that element with the last element within that portion in "a". Once you finish (or after the time limit), compare your implementation with the Java code in the slides. You can use the code from the slides (but some slight changes may be needed). Your code also needs to pass the unit test named "test2()" in "UnitTests.java". Task 3 (40 points). Complete the "quickSort(float[] a)" method so that it sorts the specified array "a" using the quicksort algorithm. For a certain time limit that you choose (e.g., 15 minutes), try to implement the method based only on your understanding of the algorithm. You can use the code from the slides (but some slight changes may be needed). Your code also needs to pass the unit test named "test3()" in "UnitTests.java".

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Online Systems For Physicians And Medical Professionals How To Use And Access Databases

Authors: Harley Bjelland

1st Edition

1878487442, 9781878487445

More Books

Students also viewed these Databases questions

Question

1. What is Ebola ? 2.Heart is a muscle? 3. Artificial lighting?

Answered: 1 week ago

Question

1. Which is the most abundant gas presented in the atmosphere?

Answered: 1 week ago