Question: Bucket sort assumes that keys are randomly distributed over some interval say [a, b]. The interval [a, b] is divided into k equal subin- tervals,
Bucket sort assumes that keys are randomly distributed over some interval say [a, b]. The interval [a, b] is divided into k equal subin- tervals, called buckets. (For example, if we were sorting names, the buckets might correspond to the first letter of the last name.) Bucket sort begins by putting each element in the array to sort in the appropriate bucket. It then sorts each bucket using an appropriate sorting algorithm. Show that at this point, if we enumerate the items in the first bucket (in sorted order) followed by the items in the second bucket (again, in sorted order) and so on, the entire array is sorted. Making appropriate assumptions (what are they?), what is the expected run-time cost of your algorithm?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
