Embed presentation
Download to read offline





![Bucket Sort Algorithm
bucketSort(arr[], n)
1) Create n empty buckets (Or lists).
2) Do following for every array element arr[i].
.......
Insert arr[i] into bucket[n*array[i]]
3) Sort individual buckets using stable sorting
algos
4) Concatenate all sorted buckets.](https://image.slidesharecdn.com/bucketsortalgorithm-221011161731-820b4ec2/75/Bucket-Sort-Algorithm-pptx-6-2048.jpg)
Bucket sort is an algorithm that divides unsorted array elements into buckets based on their value ranges. Each bucket is then sorted individually using another sorting algorithm. Finally, the sorted buckets are combined into a single sorted output array. Bucket sort works best when input values are uniformly distributed over a known range. It can also be useful for sorting floating point numbers. The algorithm involves creating buckets, inserting elements into the appropriate buckets based on their value, sorting each bucket, and concatenating the sorted buckets together.





![Bucket Sort Algorithm
bucketSort(arr[], n)
1) Create n empty buckets (Or lists).
2) Do following for every array element arr[i].
.......
Insert arr[i] into bucket[n*array[i]]
3) Sort individual buckets using stable sorting
algos
4) Concatenate all sorted buckets.](https://image.slidesharecdn.com/bucketsortalgorithm-221011161731-820b4ec2/75/Bucket-Sort-Algorithm-pptx-6-2048.jpg)