An Interest In:
Web News this Week
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
- April 19, 2024
- April 18, 2024
September 18, 2021 05:03 pm GMT
Original Link: https://dev.to/callme_shinzo/why-is-bubble-sort-called-bubble-sort-3mg5
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:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To