Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
September 18, 2021 05:03 pm GMT

Why is bubble sort called 'Bubble Sort'?

I have read many contents on bubble sort, but found one same reason for this name. The reason they said is:

Because its easy to swap soap bubble/watter bubble, and that is what we do in bubble sort, we swap those elements which satisfy our condition.

Today I got to know a good, a real-like reason while reading a blog. The reason is :

Air bubbles that are more buoyant than surrounding water rise to the top. Similarly, list elements with greater value than their surrounding elements bubble to the end of the list.

Thanks for reading...


Original Link: https://dev.to/callme_shinzo/why-is-bubble-sort-called-bubble-sort-3mg5

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To