Question: 5. Let A- [2 4 5 7 1 2 10 11 3 2] be the input array of size 10. As can be observed this

![3 2] be the input array of size 10. As can be](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3e41d2ac30_67666f3e41cc5178.jpg)
5. Let A- [2 4 5 7 1 2 10 11 3 2] be the input array of size 10. As can be observed this array has 8 distinct numbers and 3 duplicates. Now consider the quicksort algo rithm presented in Algorithm 2.5 (page 289 of textbook and slide# 20 in C2P2.pdf), and suppose that the initial random shuffle is omitted. (a) Give a permutation of A that requires least member of compares by this modified quicksort algorithm. Explain your answer in few lines. 3 marks] (b) Give a permutation of A that requires maximum number of compares by this modified quicksort algorithm. Explain your answer in few lines. [2 marks] 5. Let A- [2 4 5 7 1 2 10 11 3 2] be the input array of size 10. As can be observed this array has 8 distinct numbers and 3 duplicates. Now consider the quicksort algo rithm presented in Algorithm 2.5 (page 289 of textbook and slide# 20 in C2P2.pdf), and suppose that the initial random shuffle is omitted. (a) Give a permutation of A that requires least member of compares by this modified quicksort algorithm. Explain your answer in few lines. 3 marks] (b) Give a permutation of A that requires maximum number of compares by this modified quicksort algorithm. Explain your answer in few lines. [2 marks]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
