Question: 4. This problem is about sorting. Answer the short questions. a. For an array S={7,4,3,6}, please show all the steps for Bubble sort. b. For

4. This problem is about sorting. Answer the short questions. a. For an array S={7,4,3,6}, please show all the steps for Bubble sort. b. For an array S={16,19,5,3,17}, please show all the steps for Insertion sort. c. For an array S={31,20,53,7,15}, please show all the steps for Merge sort. d. Selecting the pivot is important in Quick sort implementation. If we use the element at the middle position as the pivot, please show an array that contains 5 elements on which the algorithm meets its worst-case condition (O(n2)). Please describe the steps of sorting and why it has the worst-case behavior
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
