Question: Java question: 11.11 (sorting an ArrayList) Write the following method that sorts an ArrayList of numbers. The sort method may not call the built in

Java question:

11.11 (sorting an ArrayList) Write the following method that sorts an ArrayList of numbers. The sort method may not call the built in sorting routines, you must write your own. See SelectionSort.java (pg. 272) for a good sorting algorithm.

public static void sort(ArrayList list)

Write a test program that prompts the user to enter 5 numbers, stores them in the ArrayList, call your sort method, and then them main displays the list in increasing order.

After you call sort and display your sorted list, add the following:

java.util.Collections.shuffle(list);

//print out the shuffled list you need to write the loop for this.

//now, add a call to the built in sort method. See 11.12 pg 440 in edition 11 and

// display the sorted list

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!