3 ms·
Can you elaborate on why bubble sort is fast on huge dataset? Also, If counting based sorting algorithm is faster in practice , why we are not seeing more of i
by RavlaAlvar 7y ago
Can you elaborate on why bubble sort is fast on huge dataset?
Also, If counting based sorting algorithm is faster in practice , why we are not seeing more of it in database system?
- taneq 7y agoThat was burst sort, not bubble sort. (That said, bubblesort can be fast if the data are usually very close to sorted - one example here is depth-sorting polygons for a rendering engine on a highly constrained platform.)
- aratakareigen 7y agoSee also: https://en.m.wikipedia.org/wiki/Adaptive_sort https://en.m.wikipedia.org/wiki/Adaptive_sort Another example application of adaptive sorts is the sweep-and-prune broadphase collision detection algorithm that's somewhat commonly used in physics engines.
- AstralStorm 7y agoDatabase systems do not operate on large strings and sort by keys rather than whole rows. And they tend to use hash maps as input invoking truly flat distributions. They also require sort stability. Burstsort and radix sort are best for cases where you actually sort based on whole or almost whole structure comparison - as in memcmp. Burstsort is also equivalent to walking a trie index in a database. So yes, you see it quite a lot.