Question: Skip List Sorting: Let A[1..n] be an array of positive integers, and let r be the difference between the largest and the smallest value in

Skip List Sorting: Let A[1..n] be an array of positive integers, and let r be the difference between the largest and the smallest value in A. (a) (2pt) Consider the array (5,3,3,7,11,7,7,1,7,3). What is r? (b) (8pt) Describe an algorithm to sort A. Your algorithm should run in time O(n +r). (Hint: Recall what I said in lecture on 1/24 about what to do to sort a bag of cash) (c) (2pt) When r is constant with respect to n, then this algorithm is faster than the (n log n) lower bound we covered in class. Explain why the sorting lower bound that we covered in lecture does not apply here.Skip List Sorting: Let A[1..n] be an array of positive integers, and

4. (12 pts.) Skip List Sorting: Let A[1..n] be an array of positive integers, and let r be the difference between the largest and the smallest value in A. (a) (2pt) Consider the array (5,3,3,7,11,7,7,1,7,3). What is r ? (b) (8pt) Describe an algorithm to sort A. Your algorithm should run in time O(n+r). (Hint: Recall what I said in lecture on 1/24 about what to do to sort a bag of cash) (c) (2pt) When r is constant with respect to n, then this algorithm is faster than the (nlogn) lower bound we covered in class. Explain why the sorting lower bound that we covered in lecture does not apply here

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!