Hacker News new | past | comments | ask | show | jobs | submit login

The only situation where I've actually employed bubble sort in production code was in a situation where the container to be sorted was guaranteed to be at most 5 elements (and usually 3) and was usually already sorted - and calling this sort was done a lot. All other sorts proved to have too much startup overhead or too much code that bloated caches.. so yes, I wrote a bubble sort to be used there and it performed quite well. But I would generally never recommend bubble sort for 99.9% of cases - but just once in a blue moon it actually can be the right answer.



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: