General Question: Why is Bucket Sort more beneficial that Quick Sort?
Lets say numbers are incoming from a stream, and my buckets are like (1,10) (11,20) ect ect.
Then I sort the buckets and then put them together, having my sorted numbers.
OR
I can put them in an array, and then sort them with Quicksort
- Bucket Sort: Bestcase O(N + K) worstcase (N^2);
- Quicksort: Bestcase O(1) Averagecase O(nlogn) worstcase (N^2);
So why do we use bucket sort for things like streams of incoming integers that we want sorted? Is it because we can make decisions based on the number of integers in each of your buckets?
Thanks