Bubble Sort
Loading...
53,449
Uploader Comments (UltimaChaosVincent)
Top Comments
-
Maybe it's inefficient and almost entirely useless, but you can't really hate Bubblesort. It's got such an adorable name!
-
this is so great ;) if anybody is asking me how to bubble sort, i start singing the chocobo song ^^
see all
All Comments (35)
-
@agentdarkboote Of course! The bidirectional bubble sort! aka the Cocktail sort according to Wikipedia!
I guess one can improve by not comparing the last item placed in each direction.
-
Quicksort forever !!!
-
hi there !
-
cool
-
Dddddddeeeeeeeaaaaaaaddddddd account now.
-
@SirCatpaw Close: you're describing the bidirectional bubble sort :D
-
@SirCatpaw Cocktail Sort.
-
-
oh now i understand!
-
What machine's making the music?
Loading...
it actually doesnt work like that, bubblesort sorts from right to left... you can check this on wikipedia :)
anyway thanks for the video, helped me a lot :D
XniX23 3 years ago
Actually, that's a misconception. It depends if you start with array.length() and work your way down, or if you start at index 0 and work your way up. You have to adjust the less than and greater than with in the if...then statement for their respective "flavor". Hope this helps :D
UltimaChaosVincent 3 years ago
if u adjust the if by switching greater than or less than.. doesnt that change from lets say, ascending order to descending for example? :)
and yes, it depends from where you start :$
XniX23 3 years ago
Thats the point? I'm confused by your comment, sorry. If you want to go from right to left and maintain the order you'd have to switch operators.
UltimaChaosVincent 3 years ago