a) Apply Bucket-Sort on the following input. Show your work in a similar way that we did in the class. Assume we use 10 buckets. A = [0.88, 0.32, 0.15, 0.6, 0.55, 0.11, 0.52, 0.12, 0.83, 0.31, 0.19, 0.81] b) We saw in the class that Bucket Sort is useful when the input is uniformly distributed. Consider the following input which is NOT uniformly sorted: n/logn items are uni- formly distributed in [0, 0.8], log² n items are uniformly distributed in (0.8, 0.9] and the remaining n - n/logn - log² n items are uniformly distributed in (0.9, 1]. Repeat the analysis from the class to describe the expected running time of Bucket- Sort with parameter k = n/20 for the above input. You may assume that we a comparison-based sorting algorithm with running time (n log n) to sort items within each bucket.
a) Apply Bucket-Sort on the following input. Show your work in a similar way that we did in the class. Assume we use 10 buckets. A = [0.88, 0.32, 0.15, 0.6, 0.55, 0.11, 0.52, 0.12, 0.83, 0.31, 0.19, 0.81] b) We saw in the class that Bucket Sort is useful when the input is uniformly distributed. Consider the following input which is NOT uniformly sorted: n/logn items are uni- formly distributed in [0, 0.8], log² n items are uniformly distributed in (0.8, 0.9] and the remaining n - n/logn - log² n items are uniformly distributed in (0.9, 1]. Repeat the analysis from the class to describe the expected running time of Bucket- Sort with parameter k = n/20 for the above input. You may assume that we a comparison-based sorting algorithm with running time (n log n) to sort items within each bucket.
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps