Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!