Explain how to implement Bucket sort so that its expected running time is O ( n )
Fantastic news! We've Found the answer you've been seeking!
Question:
Explain how to implement Bucket sort so that its expected running time is O(n) when the n elements to be sorted are independent, uniform random numbers that are chosen from [0, 1].
(b) We now consider how to implement Bucket sort when the elements to be sorted are not necessarily uniform over an interval. Specifically, suppose the elements to be sorted are numbers of the form X +Y, where (for each element) X and Y are independent, uniform random numbers chosen from [0, 1]. How can you modify the buckets so that Bucket sort still has expected running time O(n)? What if the elements to be sorted were numbers of the form max(X,Y ) instead of X +Y?
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Posted Date: