|
|
|
|
|
by Arainach
15 days ago
|
|
It's not, but it's conceptually very similar at first glance. One important thing to note is that bubble sort places one element in the correct position each pass and then *stops looking at that position ever again*. This algorithm looks at all N elements every pass. Others have shared a bunch of great videos and writeups. Without reading them, my initial assumption is that this builds things bottom up (such that after the first pass, the element in position 0 is guaranteed to be the lowest element) and that despite it being compared again and again, it's essentially placing one element each pass, but I could be wrong. |
|
Bubblesort really is a family of "this is something I figured out myself that runs by looping in O(N^2) by moving things to the front/back"