Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Bucket Sort Algorithm.pptx
1. Bucket Sort
Algorithm
BUCKET SORT IS A SORTING ALGORITHM THAT DIVIDES THE
UNSORTED ARRAY ELEMENTS INTO SEVERAL GROUPS
CALLED BUCKETS. EACH BUCKET IS THEN SORTED BY
USING ANY OF THE SUITABLE SORTING ALGORITHMS OR
RECURSIVELY APPLYING THE SAME BUCKET ALGORITHM.
FINALLY, THE SORTED BUCKETS ARE COMBINED TO FORM
A FINAL SORTED ARRAY.
4. Insert the unsorted elements in the buckets according to their
range
After all the elements are inserted in the buckets we can use
any sorting algorithm to sort these elements.
Here n=10,
Multiplying each value with n
then assigning its bucket
5. Sorted elements form the buckets are now inserted into the
original array by iterating through the buckets.
6. 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.