Question 1 (25 pts):Assume the following list of keys:49, 4, 89, 25, 67, 46, 83, 30, 60, 22, 12This list is to be sorted using the quick sort algorithm as discussed in this chapter. Use pivot as the middleelement of the list, and fill in the blank squares below.pivotpivot pivotpivot pivot pivot pivotpivot pivotpivot pivot49, 4, 89, 25, 67, 46, 83, 30, 60, 22, 12Question 2 (25 pts):Assume the following list of keys:32, 47, 3, 28, 92, 7, 87, 37, 22, 43, 40, 74, 13, 35, 51This list is to be sorted using the merge sort algorithm as discussed in this chapter. Fill in the blank squaresbelow.32, 47, 3, 28, 92, 7, 87, 37, 22, 43, 40, 74, 13, 35, 51Question 3 (25 pts):Assume the following list:32, 47, 3, 28, 92, 7, 87, 37, 22, 43, 40, 74, 13, 35, 51, 14, 26, 5(a) Using the function buildHeap as given in this chapter, convert the list into a heap.(b) Show the resulting list after three passes of heapsort. (Use the heapify procedure as given in this chapter.)One pass:Two passes:Three passes:Question 4 (25 pts):Modify the quick sort implementation in the textbook to sort the array using pivot as the median of the first, last,and middle elements of the array. Add the modified quick sort implementation to the arrayListType classprovided (arrayListType.h). Ask the user to enter a list of positive integers ending with -999, sort the integers, anddisplay the pivots for each iteration and the sorted array.Submit the source code, and copy and paste the screenshot of the output here
Question 1 (25 pts):Assume the following list of keys:49, 4, 89, 25, 67, 46, 83, 30, 60, 22, 12This list is to be sorted using the quick sort algorithm a
Question 1 (25 pts):Assume the following list of keys:49, 4, 89, 25, 67, 46, 83, 30, 60, 22, 12This list is to be sorted using the quick sort algorithm as discussed in this chapter. Use pivot as the middleelement of the list, and fill in the blank squares below.pivotpivot pivotpivot