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}
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.