Question: 1 - Examine the code and run it to be familiar with. 2 - ( 4 . 5 pts ) Write the following methods (

1- Examine the code and run it to be familiar with.
2-(4.5 pts ) Write the following methods (see the reserved space in the code):
Selection sort with an array of strings as parameter (instead of int or double).
Insertion sort with an array of strings as parameter.
Bubble sort with an array of strings as parameter.
Remark: 0.5pt will be given to the screenshots in tasks 4 and 5.
3-(1 pt) Add the needed code to calculate the times elapsed before and after calling each of these methods. These calculations can be done similarly to what is done in the main with other methods.
4- At this point, take screenshots of all the 6 different times elapsed. The ratios are not required. You can expect that the required times for the merge sort methods to be smaller than the others in general (difference between O(nlogn) and O(n2)).
5-(1 pt) Now, to visualize the results of all these methods, change the value n from 1000000 to 10, and print the 6 lists after calling the 6 corresponding methods. Hint: You can print them using, for example, Arrays.toString (1ist1). Include a screenshot of this result. This task could be also done before task 3.
Extra credit (1 pt): add the method QuickSort to your code and calculate the time elapsed of its execution. Include a screenshot of the sorted elements after calling your method.
1 - Examine the code and run it to be familiar

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!