Javatpoint Logo
Javatpoint Logo

Bucket Sort

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

Algorithm Complexity
Space O(1)
Worst Case O(n2)
Best Case Ω(n+k)
Average Case θ(n+k)


  • 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


Next TopicComb Sort

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA