3 ms·
The author recommends to use bucket-sort or traditional sorting for floats, but you can actually apply both to floats as well to get the guaranteed "linear" tim
by lynndotpy 5y ago
The author recommends to use bucket-sort or traditional sorting for floats, but you can actually apply both to floats as well to get the guaranteed "linear" time.
Counting sort is similar and also a bit better, at O(k + n) rather than O(kn).