Simple Sorting Practice Quiz
Practice Problem
Take out a piece of paper and put your name on the upper right corner.
Write a simple Java class that has one static method:
public static <E> void bubbleSort(E[] data, Comparator<E> compare);
The method must use the Bubble Sort algorithm to sort the data array.
Remember the Comparator<E> interface defines the following method:
int compare(E o1, E o2); // Returns negative if o1 < o2, 0 if equal, positive if o1 > o2
Be sure to write JavaDoc comments for your code.
Conduct a quick review of your code, before you are done.
After the code, write an explanation the Big-O performance of the bubbleSort method.
Time Remaining:
You can restart the timer by reloading the page.
Try to complete the problem in 25 minutes.
If you cannot complete the program in 25 minutes, you can watch me solve the problem in a text editor.