Bucket sort is also known as bin sort. It works by distributing the element into the array also called buckets. Buckets are sorted individually by using different sorting algorithm.
Complexity of Bucket Sort
- Step 1 START
- Step 2 Set up an array of initially empty "buckets".
- Step 3 Scatter: Go over the original array, putting each object in its bucket.
- Step 4 Sort each non-empty bucket.
- Step 5 Gather: Visit the buckets in order and put all elements back into the original array.
- Step 6 STOP