8 ms·
When the bucket of things to sort drifts below count ~100, bubble sort will hammer it into order in an amount of time which is, for all intents and purposes, ze
by vandyswa 3y ago
When the bucket of things to sort drifts below count ~100, bubble sort will hammer it into order in an amount of time which is, for all intents and purposes, zero. Use the smallest hammer which drives the nail...
- kevin_thibedeau 3y agoAlso a good time to shelve any binary search because linear search will beat it for short sequences. The threshold varies by platform.
- dekhn 3y agoThis is also known as "hardware caches and branch prediction beat smart humans almost every time"