Answered! 1.a. Modify the following figure to illustrate the operation of PARTITION on the array:…

1.a. Modify the following figure to illustrate the operation of PARTITION on the array:

A = {11,17,8,4,12,7,6,21,9,10}

i pj (a) p, i j 2871 3564 (b) (c) 2 8 7 1 3 5 6 4 p,i E8 7 (d) p i 1 7 8 3564 (e) 2 1 3 7 564 (f) 2 21 3 875 (g) 2 113 87 56 21 34 568

1 b. Modify the QUICKSORT and PARTITION procedures to sort in decreasing order.

Expert Answer

 1 (a) Following are the steps to partition the given array: {11, 17, 8, 4, 12, 7, 6, 21, 9, 10}

At the end, the partition function returns ( i + 1) that is the position at which 10 exists as the pivot.

Still stressed from student homework?
Get quality assistance from academic writers!