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

Well, many people who tried to implement the bubble sort for the first time “invented” this algo, it’s just not optimized bubble rather then insertion sort, is it worth an article?



If you read elsewhere in this thread you'll see that there really is enough discussion to suggest that yes, this is worth an article.

And it really, really isn't Bubble Sort. One of the defining features of Bubble Sort is that it only ever compares elements in adjacent locations. Others are claiming that if you optimise this then it becomes Bubble Sort, but someone else observes that if you "optimise" differently you end up with Insertion Sort.

That suggests that this is not Bubble Sort. It's something different that can be mutated into Bubble Sort, but it is, of itself, not Bubble Sort.




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

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

Search: