Overview
Bucket Sort works well when values are spread across a known range and can be assigned to useful buckets.
Sorts by distributing values into buckets and sorting within each bucket.
Compact metadata for implementation and discovery.
Bucket Sort works well when values are spread across a known range and can be assigned to useful buckets.
Quick facts
Runtime and memory behavior at a glance.
Best
O(n + k)
Average
O(n + k)
Worst
O(n^2)
Space
O(n + k)
Show values falling into buckets and then being read in order.
Bucket Sort operates in O(n + k) time and O(n + k) space within the Distribution Sort family. Often compared with Counting Sort and Radix Sort.
What each reference supports for this entry.
Textbook support for Bucket Sort invariants, recurrences, relaxation rules, or asymptotic analysis.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Bucket sort and counting sort both exploit key distribution instead of comparison order.