Question: Assume that you run bucket sort using bubble sort to sort the buckets. (a) Assume that n/k buckets have k items (and the remaining
Assume that you run bucket sort using bubble sort to sort the buckets. (a) Assume that n/k buckets have k items (and the remaining buckets have no items). Exactly how many comparisons does bucket sort do? Show your work. (b) Assume that the first bucket has one item, the second bucket has two items, the third bucket has three items, etc., until there are no more items. You can assume that n = k(k+1)/2 so that this works out evenly. How many comparisons does bucket sort do? Just get the exact high order term. Show your work.
Step by Step Solution
There are 3 Steps involved in it
a In this case where nk buckets have k items and the remaining buckets have no items you can calcula... View full answer
Get step-by-step solutions from verified subject matter experts
