[Solved]1 Following General Code Quicksort Algorithm Void Qsort T Data Const Int Start Const Int E Q37220628

1. The following is the general code for the quicksort algorithm. void qsort (T data, const int start, const int end) if (start>end) int mid -partition (data, start,end); qsort (data, start,mid-1) qsort (data,mid+1,end); (5pts) What is the purpose of the partition function? (10pts) Ideally we want the median, but practically we have to guess. Explain how such a partition function may work. You can use pseudo-code or diagrams, or actual code. a. b. c. (10pts) Trace the operation of the qsort function using diagrams as it sorts the following array a-(15, 4, 9, 10, 3, 25, 13, 6) using an ideal partition function. Show transcribed image text 1. The following is the general code for the quicksort algorithm. void qsort (T data, const int start, const int end) if (start>end) int mid -partition (data, start,end); qsort (data, start,mid-1) qsort (data,mid+1,end); (5pts) What is the purpose of the partition function? (10pts) Ideally we want the median, but practically we have to guess. Explain how such a partition function may work. You can use pseudo-code or diagrams, or actual code. a. b. c. (10pts) Trace the operation of the qsort function using diagrams as it sorts the following array a-(15, 4, 9, 10, 3, 25, 13, 6) using an ideal partition function.
Expert Answer
Answer to 1. The following is the general code for the quicksort algorithm. void qsort (T data, const int start, const int end) if… . . .
OR

