Question: Input arrays: Input1 = [11, 21, 31, 41, 51] Input2 = [51, 41, 31, 21, 11] Input3 = [11, 51, 21, 41, 31] For example,
Input arrays:
-
Input1 = [11, 21, 31, 41, 51]
-
Input2 = [51, 41, 31, 21, 11]
-
Input3 = [11, 51, 21, 41, 31]
For example, for selection sort and input3 the list of iterations looks like this:
| Iteration: 0 | [11, 51, 21, 41, 31] |
| Iteration: 1 | [11, 51, 21, 41, 31] |
| Iteration: 2 | [11, 21, 51, 41, 31] |
| Iteration: 3 | [11, 21, 31, 41, 51] |
| Iteration: 4 | [11, 21, 31, 41, 51] |
| Iteration: 5 | [11, 21, 31, 41, 51] |
You need to trace three sorting algorithms:
-
Insertion Sort,
-
Quick Sort. Use the first element as a pivot.
-
TimSort. This is the sort that you will also implement and we described it in Part2. Please click here to jump to the description. Use param = 2.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
