Question: All algorithms are in pseudocode Problem 2. (15p) Consider the following strange sorting algorithm procedure SoMESoRT(A, 1,r) if l+1 then if A]> Afr] then exchange

All algorithms are in pseudocode

All algorithms are in pseudocode Problem 2. (15p) Consider the following "strange"

Problem 2. (15p) Consider the following "strange" sorting algorithm procedure SoMESoRT(A, 1,r) if l+1 then if A]> Afr] then exchange AAr else if r >11 then SomeSort (A,l,r-p) SomeSort (A,1+p,r) SomeSort (A,l,r-p) 2.1 (2p) Illustrate the behavior of Some Sort on the input A =30, 20, 10] with l = 1 and r = 3 2.2 (6p) Prove that SomeSort correctly sorts any input array A of size n-l-r +1. A sketch of 2.3 (6p) Analyze the efficiency of SomeSort in the worst case. Set up a recurrence relation and 2.4 (1p) Compare the worst case runtime for SomeSort to that of the other sorting algorithms the correctness proof is enough. You can assume that n 3p give a tight asymptotic bound we've learned (selection sort, insertion sort, merge sort). Would you use this algorithm? Problem 2. (15p) Consider the following "strange" sorting algorithm procedure SoMESoRT(A, 1,r) if l+1 then if A]> Afr] then exchange AAr else if r >11 then SomeSort (A,l,r-p) SomeSort (A,1+p,r) SomeSort (A,l,r-p) 2.1 (2p) Illustrate the behavior of Some Sort on the input A =30, 20, 10] with l = 1 and r = 3 2.2 (6p) Prove that SomeSort correctly sorts any input array A of size n-l-r +1. A sketch of 2.3 (6p) Analyze the efficiency of SomeSort in the worst case. Set up a recurrence relation and 2.4 (1p) Compare the worst case runtime for SomeSort to that of the other sorting algorithms the correctness proof is enough. You can assume that n 3p give a tight asymptotic bound we've learned (selection sort, insertion sort, merge sort). Would you use this algorithm

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!