Question: In java Part 4 Create a method with the following header: public static void runJavaSort ( int [ ] ar ) This method should call

In java
Part 4
Create a method with the following header:
public static void runJavaSort(int[] ar)
This method should call the Arrays.sort to sort ar.
Note: Arrays.sort uses a combination of sorts to sort the data (quicksort, mergesort, insertion sort, and heapsort).
Part 5
public static void bubbleSort(int[] ar)
Implement the bubble sort algorithm. It should sort the int[] parameter. Here is the pseudocode for bubble sort:Part 6
Test both sorts in main:
Call runJavaSort on ar1.
Call bubbleSort on ar2.
Show both sorted arrays on screen.
Part 7
Run each sort in main and calculate how many nanoseconds it takes for each to run. You should print the results on screen.
Here is sample code to get the current time in nanoseconds:
long currentTime = System.nanoTime();
In java Part 4 Create a method with the following

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 Programming Questions!