4 ms·
Without looking further, I would say it's because elements bubble up as they're sorted. Edit: Wikipedia [1] seems to agree: The algorithm, which is a comp
by ORioN63 6y ago
Without looking further, I would say it's because elements bubble up as they're sorted.
Edit: Wikipedia [1] seems to agree:
The algorithm, which is a comparison sort, is named for the way smaller or larger elements "bubble" to the top of the list.
[1] https://en.wikipedia.org/wiki/Bubble_sort https://en.wikipedia.org/wiki/Bubble_sort