Question: 3. Question 3 is about Sorting Algorithms. We assume that the output should be sorted in ascending order from smallest to largest. (a) [2 Marks

3. Question 3 is about Sorting Algorithms. We assume that the output should be sorted in ascending order from smallest to largest. (a) [2 Marks Suppose that your Quick-Sort algorithm uses a pivot rule that picks n- of size n, it uses the element in Aln/2) as pivot if n is even and the element in Al(n- 1)/2 as pivot if n is odd. lustrate how this algorithm works using a quick-sort tree on the input: 76 5 4 3 2 1 (b) [2 Marks] What is the running time of this version of quick-sort on sequences of size n that are already sorted from largest to smallest? Explain why by writing dowin the recurrence equation for the running time of your algorithm on such sequences
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
