This content originally appeared on DEV Community and was authored by CallMe_Shinzo
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...
This content originally appeared on DEV Community and was authored by CallMe_Shinzo

CallMe_Shinzo | Sciencx (2021-09-18T17:03:44+00:00) Why is bubble sort called ‘Bubble Sort’?. Retrieved from https://www.scien.cx/2021/09/18/why-is-bubble-sort-called-bubble-sort/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.