Question: Given the values 10, 3, 1, 4, 8, 5, 11, 9, 2, 6, 7 stored in an array in that order, provide the states of

 Given the values 10, 3, 1, 4, 8, 5, 11, 9,

Given the values 10, 3, 1, 4, 8, 5, 11, 9, 2, 6, 7 stored in an array in that order, provide the "states" of the array while being sorted for the sorting algorithms specified. Please write the contents of the array on a separate line for each state. a. For insertion sort, show the first 4 states of the array as it is sorted by insertion sort, one state on each line. The "states" are achieved at the end of the for-loop when an entry has been moved to is currently proper position. b. Apply Shellsort using Shell's increment showing the 3 states of the array. The "states" are achieved at the end of the sorting based on each of the 3 increments. c. Apply heapsort to the array until the 10 and 11 are in the correct positions. Show the 5 states of the heap as you use build heap when each sub-heap has been made into a heap, and then the two states of the array necessary until the 10 is in the proper position. d. Show the first 3 states that occur when applying quicksort to the array using median of 3, and cut-off of 2. A state occurs when quicksort has been applied to a subarray. There should be only one new pivot on each line. Underline the pivot used for each line. Apply the cut-off sort on the next line. When there are multiple subarrays to be sorted, choose to the subarray with the smaller values first

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!