Bucket Sort Visualizer

Watch how Bucket Sort distributes elements into buckets, sorts each bucket individually, and concatenates them for the final result.

Time: O(n + k) avg
Space: O(n + k)
Stable: Yes
Distribution-based
Fast (600ms)Slow (3000ms)
Progress: Step 1 of 0Phase: start | Buckets: 3

Current Array

64
0
34
1
25
2
12
3
22
4
11
5
90
6

Buckets

Bucket 0
Empty
Bucket 1
Empty
Bucket 2
Empty
Array Elements
Currently Processing
Active Bucket
Sorting Bucket
Sorted

Current Step:

Click Start to begin the Bucket Sort visualization

Algorithm Details

Best Case:O(n + k)
Average Case:O(n + k)
Worst Case:O(n²)
Space:O(n + k)
Stable:Yes
In-place:No

n = number of elements

k = number of buckets

When to Use Bucket Sort

  • Uniformly distributed data
  • Known range of input values
  • Floating-point numbers in [0,1)
  • When stability is required
  • Skewed or clustered data distribution
  • Unknown or very large value ranges
  • Memory-constrained environments

Real-world Applications

  • Sorting floating-point numbers
  • Histogram creation
  • Parallel sorting algorithms
  • External sorting of large datasets
  • Statistical data analysis

Key Characteristics

  • Distribution-based sorting algorithm
  • Performance depends on data distribution
  • Uses auxiliary sorting for individual buckets
  • Can achieve linear time with good distribution