I thought this too. It is amazing seeing how even when you code using comparisons (using if/for/switch) you could have the same output using a more developed algorithm much more quickly.
@@luisandre2750i dont understand what u say lmfao, yes computers use if and? That takes some time, its not literally instantanious, it never is, thats why you need optimization and that is what this sorting algorithm does
+ziska dor Lights are out, everybody's cleared out of their seats and gone home. The janitor is about to ask him to hurry up so he can clean the floor.
+marquizzo He says nothing. Keeps on sorting. Janitor mops around him. Doors open the next day. The celebration finally sounds as he clicks in his last comparison.
@@MikehMike01 Things just seemed a bit harder in the 90s and Google was not as reliable. I know however that most people can make these discoveries on their own. I'm just reminiscing with these people how great it felt and yet how far from the mark we were.
this is the cutest video i have ever seen in my entire life, after watching so many boring videos trying to explain quick sort, this is a very welcomed treat
Making computers look cute while also teaching a great concept in a lot of web development? Win-win! Also, noting how the computers are short-sighted is a very good way of describing how computers actually do operations.
***** ... or the next level : 3 "Bogobogosort is an algorithm that was designed not to succeed before the heat death of the universe on any sizable list. It works by implementing the bogosort on the first two elements in the list. If they are in order, then it bogosorts the first three elements, and so on, increasing by one until the entire list is sorted. Should the list not be in order at any point, the sort starts over with the first two elements."
yeah? well in a comment above im trying to bogo sort the word "sort" alphabetically. I do it in batches of 10, random data gotten from www.superkids.com/aweb/tools/words/scramble/ and now going to my 4th batch
th-cam.com/video/aXXWXz5rF64/w-d-xo.html&lc=z12xy3dixtf2tn5cg223yfyzxkqdztugn04.1498860895564993 BOGO SORT BRIEF EXPLANATION AND 49-TRY EXAMPLE WITH 4 INTEGER (CHARACTER) VALUES
Thanks! Currently I'm busy with two other videos (coming up soon), but I appreciate the interest in more sorting videos. I hope to get around to it soon.
I am pleased at how accurate the video is. It didn't just count comparisons only, but moved the robots according to performed actions (cycles as it were).
Dude I mean why or how, this videos are so old and they are so cool, the quality is genuinely amazing, I love your videos and the educational content they bring, make more!
You should make a visualization for all existing sorting algorithm. Your videos are really helpful, and the best that could be find online to explain how the sorts work.
First off, curse you for having a right-to-left-language username, because replying to those screws up your left-to-right typing if you include it. Second, there are way too many sorting algorithms to explain. Many of them are hybrids (like Timsort), many don't work on these colored balls (like Radix Sort), and many are esoteric (not intended to be actually useful, like Bogosort and Slowsort). That and some of them are just *weird* (like Gravity Sort).
TH-cam in 2012: Oh, look at him, he is learning algorithms! I should recommend it to him some time later. TH-cam in 2020: eah! This just the right time!
This is the best educational video I've ever seen. I think using numbers in place of the balls could make the whole process more clear, for in the competition it is difficult to follow what is going on.
udipod, I just accidentally ran into your video. They're all great. You don't mind telling me what tool/software your used to create the animation? Or your write it yourself? Thanks John N.
+udiprod ! Thanks a lot for the info. You're done a great job of explaining computer/physics concepts. Keep up with good works. Can't wait to see more of your videos. Have a nice day! John N.
It places on the ledge a ball from the left side that is designated to be swapped with a ball from the right side. Usually when two elements are swapped, one of them is placed in a temporary location. What's a bit unusual here, is that the element is placed in a temporary location before selecting the ball it should be swapped with. The reason is that the robot has only one free hand (the other one holds the pivot), and putting the ball on the ledge saves moves later when the swap takes place.
Amazing video. I always thought there should be a visualization program that visualizes computer code algorithm in a nice way like you've done here for these sorting algorithms, it could have a visual that shows how data is being passed around and manipulated in the computer code or perhaps computer networking. Maybe you're the guy who should make them! Thanks again for the awesome vid.
I remember when I learned Java and my teacher expected us to do plan and program such a thing like "bubble sort", but we did it with buckets as long as I remember :)
Radix is very powerful, beating even quicksort and mergesort if the keys in the sequence are short enough, but it takes a lot of memory, stinks on longer keys, and only works on numbers (so no colored ball sorting). If you want to go all the way, counting sort is even faster than radix in an optimal set of elements, but it only works on positive integers (similar to radix but it can't even hypothetically handle decimals), takes even more memory than radix (as much memory as the biggest element), and is even slower if the biggest element is too big (even if the other elements are smaller).
@@anonymoususer9837 Ball colors can be expressed in 'brightness'. For example, the above spheres can be '000000' for the pitch black one, and 'FFFFFF' for the brightest one. From there, Radix can sort the balls
These are fun to watch. Though I think all these approaches could all be explained in a single video. That would be nicer than having to watch all these Separate Great job making this random subject engaging though :D
It's actually not cheating. Bubble sort has an optimization that if in a certain iteration all the pairs are in order, then it concludes no further iterations are needed. It most likely happens in the one of the final iterations, but with luck it can happen early. If you give bubble sort an already sorted list, it will stop after one iteration. Therefore if bubble sort and quick sort competed over on already sorted list, bubble sort would win.
udiprod I didn't suggest that it should have run an additional iteration. It just never compared the last two balls, before marking them sorted. It checked the second and third, and then assumed the first was in order, marking all three at the same time.
Asbjørn Grandt That's because all 3 were already sorted. Ok, let me explain, and also to the other people that liked your comment. In the end, we had a section that was already sorted, the balls that were lit up, and a section that was unsorted, the 3 balls at the end. When bubblesort went to sort out the last 3 balls, it compared the first 2, no swap was made, then it compared 2 and 3, and no swap was made. We have bubblesorted the unsorted section, no swaps were made during that iteration, now we can assume that the unsorted section has been sorted (since there were no swaps) this is because an efficient bubblesort has a "swap" flag that is turned on if a swap was made, since we ran through the 3 unsorted balls, without turning on this flag, then bubblesort knows all element in this unsorted section are sorted. You can see this at 3:05 where bubblesort checked all 3 balls in the unsorted section and did not make any swaps, leaving the swap flag down, meaning we can stop the algorithm early.
@Asbjørn Grandt Hehe...it's because already knew the list was sorted! How? The last pass it performed was: "Swap 1 2? No. Swap 2 3? No." If it's all no's, all the smaller elements are already on the left, and the bigger ones on the right, meaning that the list is already sorted.
Eh, problem is the robot's movement takes time, which is not true when sorting something with random access. Somewhat comes back when you think about cache misses, but still. The memory itself is random access.
Cool, but is it fair to include the time of the robots traveling since in reality the code/sorting algorithm would not require the robots to move and they would essentially be at the same place solely depending on how many comparisons they had made.
Sorting algorithms performance can be evaulated according to several criteria. Comparisons may be the most important one, but there are others, e.g., swaps (memory writes). Also, if the algorithm moves around a lot it can impact performance, since a computer's memory is usually optimized for speed assuming the program accesses close locations. If it jumps around it becomes slower (this is only true if the sorted list is really big). Anyway, the video mainly focuses on comparisons, like you say. The robot moving slows them down a bit, but doesn't effect the end result.
Though people might have mistaken that quicksort is just slightly quicker than bubble sort from this animation because you only showed it on 10 items. But in reality, quicksort can be tremendously quicker if the number of items is in order of millions or billions. It can mean that bubble sort uses a year while quicksort uses 10 minutes.
There are several different pivot rules for quick sort, such as random pivot you used, first pivot, last pivot, middle pivot and median of three (median of first, middle and last pivot).
god, I hate how these are 'intuitively' explained. By using the simplest explanation they think it makes it more 'palatable', but what really happens is the parameters are not understood and the example is lost. When someone hears the example "The robot has short vision", their immediate thought would be "Well why don't they make a robot that can see all the balls clearly?"
Bubble sort is so short sighted he didn’t even see that he lost
He doesn’t have ears
He might be deaf, he might be blind, but he sure as heck ain't dumb.
pure gold comment 😂😂😂😂😂
I think if quick sorting loss they won’t know either
That’s… actually true.
I like how after it announces that quick sort won, it just lets bubble sort slowly and pitifully complete its sort.
bubble sort be like "I hate my life"
xD
Bubble Sort be like "I'm doing my job! ^o^ you go here, you go there... and there you go!"
Bruh this is me at me job watching everyone leave as i stay behind to close T_T
And we hate bubble sort's life too...
bogo: hand me the gun
This has to be the best educational video on sorting I have ever seen!
I thought this too. It is amazing seeing how even when you code using comparisons (using if/for/switch) you could have the same output using a more developed algorithm much more quickly.
Hungarian dance sorting is much better
Check it out!
9 years later we got better
@@luisandre2750i dont understand what u say lmfao, yes computers use if and? That takes some time, its not literally instantanious, it never is, thats why you need optimization and that is what this sorting algorithm does
Bubble sort will always have a special place in my heart :')
When u necropost BP
@@smortboi2374 nani?
@@ImmacHn you're a man
me too
omg i felt so sorry for bubble sort robot at the end :(
+ziska dor Lights are out, everybody's cleared out of their seats and gone home. The janitor is about to ask him to hurry up so he can clean the floor.
+marquizzo so sad :(
+marquizzo He says nothing. Keeps on sorting. Janitor mops around him.
Doors open the next day. The celebration finally sounds as he clicks in his last comparison.
I felt sorry for it the entire time. Just think about how many balls he had so close to his face...
imagin bogo sort robot :(
The moral here is to never give up even when you lose
But you never lose if the match never ends!
The bubble Sort Robot still came to a final Solution even if it took years :) its becauz he didnt gave up
Trump
Bubble sort is me 😔
the moral here is that bubble sort fucking sucks lmao
I like that quicksort isn’t annoying bubble sort and letting him just do his thing. Such a nice guy
bubble sort: what is my purpose?
me: to sort in O(n^2)
bubble sort: omg
Yes
Bubble sort be like, "I thought bigger was always better."
Insertion sort intensifies
I thought bubble sort would do 10^2 comparisons
@@slowmotion2300Bro thought bubble sort had constant complexity 💀💀💀
Legend has it that the bubble sort robot is still sorting
Now imagine if it was a Bogosort robot!
ORST
is the alphabetically sorthed correct order
By going: Quick Sort
Pivot: R
S>R = S to the right (Memory) | [S]O T
T>R = T to The right | [S]O T
S
Tom Tom That would be the Bogo sort bro
Lets just do merger sort then
SORT = 19-15-18-20
[19][15][18][20]
19>15
[15-19][18][20]
18
so awesome , we spent 45 minutes in college for what we could have learned through this video
Interestingly I discovered bubble sort without being taught it. Only later finding out what it was called.
@@Muhammad-sx7wr most people could come up with bubble sort, insertion sort, or selection sort on their own
@@MikehMike01
Things just seemed a bit harder in the 90s and Google was not as reliable. I know however that most people can make these discoveries on their own. I'm just reminiscing with these people how great it felt and yet how far from the mark we were.
@@MikehMike01and to discover things like quicksort or heapsort only through intuition it would require to be an astute mathematician I think.
@@Muhammad-sx7wr those three are the O(n²) algorithms which aren’t very good but are easily understood
this is the cutest video i have ever seen in my entire life, after watching so many boring videos trying to explain quick sort, this is a very welcomed treat
Making computers look cute while also teaching a great concept in a lot of web development? Win-win!
Also, noting how the computers are short-sighted is a very good way of describing how computers actually do operations.
What about a bogo sort :P
*****
... or the next level : 3
"Bogobogosort
is an algorithm that was designed not to succeed before the heat death of the universe on any sizable list. It works by implementing the bogosort on the first two elements in the list. If they are in order, then it bogosorts the first three elements, and so on, increasing by one until the entire list is sorted. Should the list not be in order at any point, the sort starts over with the first two elements."
Derek Mallory there's always a chance that it will sucessfully sort tho!!
Don't forget the king of all inefficient sorts: Worstsort.
yeah? well in a comment above im trying to bogo sort the word "sort" alphabetically. I do it in batches of 10, random data gotten from www.superkids.com/aweb/tools/words/scramble/ and now going to my 4th batch
th-cam.com/video/aXXWXz5rF64/w-d-xo.html&lc=z12xy3dixtf2tn5cg223yfyzxkqdztugn04.1498860895564993
BOGO SORT BRIEF EXPLANATION AND 49-TRY EXAMPLE WITH 4 INTEGER (CHARACTER) VALUES
Thanks! Currently I'm busy with two other videos (coming up soon), but I appreciate the interest in more sorting videos. I hope to get around to it soon.
I never knew how Quick Sort managed to have confidence in it's placement without going to the ends first.
That cleared it up really easily.
Great video. Kids nowadays have so much good resource
Those have got to be the cutest robots I've ever seen. Look at 'em sort!
When I grow up I want to be a sorting robot..
Quicksort or Bubblesort or Bogosort?
How inspirational.
Are you a grown up now? What are you doing now?
@@devrafed he is sorting parcel in postoffice so he is not exactly the robot but some kind.
You need to sort yourself out first.
Someone has to do an edit of this video with the "The Rock stare" everytime the announcer say balls
I am pleased at how accurate the video is. It didn't just count comparisons only, but moved the robots according to performed actions (cycles as it were).
Dude I mean why or how, this videos are so old and they are so cool, the quality is genuinely amazing, I love your videos and the educational content they bring, make more!
You should make a visualization for all existing sorting algorithm. Your videos are really helpful, and the best that could be find online to explain how the sorts work.
different but there you go th-cam.com/video/kPRA0W1kECg/w-d-xo.html
Gravity sort
First off, curse you for having a right-to-left-language username, because replying to those screws up your left-to-right typing if you include it. Second, there are way too many sorting algorithms to explain. Many of them are hybrids (like Timsort), many don't work on these colored balls (like Radix Sort), and many are esoteric (not intended to be actually useful, like Bogosort and Slowsort). That and some of them are just *weird* (like Gravity Sort).
TH-cam in 2012: Oh, look at him, he is learning algorithms! I should recommend it to him some time later.
TH-cam in 2020: eah! This just the right time!
I want to hug bubble robot, he deserves it.
Props to bubble sort for never giving up. A true inspiration!
Why don't you give the robot glasses?😊
Well, it wouldn't have vision problems anymore, now would it?
Yeah, Glasses Bubble Sort is the fastest. Scientists should invent it.
I see what you did there...
@@miksuko omg
jeffrey Presley Well who designed their vision sensors so near sighted in the first place?
*If your into robotics at all, you’ll get this.*
"this robot is short-sighted and can only compare balls when they're right in front of its' eyes"
This is the only video that explained quick sort in a way I can understand
This is the best educational video I've ever seen. I think using numbers in place of the balls could make the whole process more clear, for in the competition it is difficult to follow what is going on.
i got distracted when i heard "balls"
udipod,
I just accidentally ran into your video. They're all great.
You don't mind telling me what tool/software your used to create the animation? Or your write it yourself?
Thanks
John N.
+confused Thanks :) I'm using a tool called Autodesk Maya. It's very powerful but not easy to learn.
+udiprod !
Thanks a lot for the info.
You're done a great job of explaining computer/physics concepts. Keep up with good works. Can't wait to see more of your videos.
Have a nice day!
John N.
you don't have to write comments like letters
@@zork34 😂😂lmao right
@@zork34 Although it's probably the easiest way to get a reply from a channel like this.
The lore behind all these sorting videos I’ve been binge watching
Super relaxing
The robot is not the only one that needs balls close to its eyes
It places on the ledge a ball from the left side that is designated to be swapped with a ball from the right side. Usually when two elements are swapped, one of them is placed in a temporary location. What's a bit unusual here, is that the element is placed in a temporary location before selecting the ball it should be swapped with. The reason is that the robot has only one free hand (the other one holds the pivot), and putting the ball on the ledge saves moves later when the swap takes place.
Bubble sort's perseverance is truly inspiring.
Nearly 1am and TH-cam recommends this out of the blue. And I watch it anyway. Thus is life.
Even though I knew the outcome before they started I still wanted bubble sort to win. They're so cute!
What a painstaking process should have been to animate that contest. hats off.
The BubbleSort guy is smarter: he lets the other guy win, so he isn't bothered with these stupid tasks anymore!
Just WOW, this visualization is on another level!
Your visualizations are awesome! This is how educational material should be like!! thnx
More insightful than meets the eye. Tiny training video to algorithms. Cool CGI.
Winner! Bubblesort is like, I don't give a crap, gotta finnish this s_t.
boy this new series of battlebots is going great.
9_in
11_order.
4_the
6_of
8_sentence
3_sort
5_words
1_Hello,
7_this
2_please
10_acending
Hello please sort this sentence in ascending order.
Counting sort 😀
I think you gave me OCD.
I'll start with a swap
8_sentence
11_order.
4_the
6_of
9_in
3_sort
5_words
1_Hello,
7_this
2_please
10_acending
Hello, please sort the words of this sentence in ascending order
Ahhh, so Sorting competitions are going to be what replaces sports when the robots take over. Very informative.
This is the quality aesthetic i signed up for.
Yay you let Bubble Sort finish this time!
Btw, if you were able to make more videos like this on other sorting algorithms, it'd be extremely helpful!
Amazing video. I always thought there should be a visualization program that visualizes computer code algorithm in a nice way like you've done here for these sorting algorithms, it could have a visual that shows how data is being passed around and manipulated in the computer code or perhaps computer networking. Maybe you're the guy who should make them! Thanks again for the awesome vid.
I remember when I learned Java and my teacher expected us to do plan and program such a thing like "bubble sort", but we did it with buckets as long as I remember :)
Who watched till the end? That bubble sort deserves some attention
Wow, I wish I had this sort of video when I was in CS in college. Great work, great channel!
"Sort theese balls"
Is it just me or I just binge watch all of these sorting analysis videos
Wow! Excellent Visualization. Cool.
Thx, you saved my engineering diploma.
This is an adorable way to explain algorithms to kids
Quick sort made the best comeback in history!
Nice explanation!
I'm learning this for Visual Basic and i was very moody till i saw this video. Awesomely made :D
Great video, explains the algorithm quite well!
Don't feel sad for the bubble sorting bot. He's doing his best
radix sort pls
Radix is very powerful, beating even quicksort and mergesort if the keys in the sequence are short enough, but it takes a lot of memory, stinks on longer keys, and only works on numbers (so no colored ball sorting).
If you want to go all the way, counting sort is even faster than radix in an optimal set of elements, but it only works on positive integers (similar to radix but it can't even hypothetically handle decimals), takes even more memory than radix (as much memory as the biggest element), and is even slower if the biggest element is too big (even if the other elements are smaller).
I want to see the base 10 one. You know, the ear rape one?
@@anonymoususer9837 Ball colors can be expressed in 'brightness'. For example, the above spheres can be '000000' for the pitch black one, and 'FFFFFF' for the brightest one. From there, Radix can sort the balls
"I hurt myself today" - Bubble Sort
These are fun to watch. Though I think all these approaches could all be explained in a single video.
That would be nicer than having to watch all these Separate
Great job making this random subject engaging though :D
I think bubble was just a little nervous. With a name like quick sort as the opponent I would have been too. Good job both of u
I was watching historical youtube video's on how WWI started and ended here. Quick sort wins.
This channel is quality.
Bubble Sort cheated at the end. It didn't compare the last two...
It's actually not cheating. Bubble sort has an optimization that if in a certain iteration all the pairs are in order, then it concludes no further iterations are needed. It most likely happens in the one of the final iterations, but with luck it can happen early. If you give bubble sort an already sorted list, it will stop after one iteration. Therefore if bubble sort and quick sort competed over on already sorted list, bubble sort would win.
udiprod
I didn't suggest that it should have run an additional iteration. It just never compared the last two balls, before marking them sorted. It checked the second and third, and then assumed the first was in order, marking all three at the same time.
Asbjørn Grandt That's because all 3 were already sorted. Ok, let me explain, and also to the other people that liked your comment. In the end, we had a section that was already sorted, the balls that were lit up, and a section that was unsorted, the 3 balls at the end. When bubblesort went to sort out the last 3 balls, it compared the first 2, no swap was made, then it compared 2 and 3, and no swap was made. We have bubblesorted the unsorted section, no swaps were made during that iteration, now we can assume that the unsorted section has been sorted (since there were no swaps) this is because an efficient bubblesort has a "swap" flag that is turned on if a swap was made, since we ran through the 3 unsorted balls, without turning on this flag, then bubblesort knows all element in this unsorted section are sorted. You can see this at 3:05 where bubblesort checked all 3 balls in the unsorted section and did not make any swaps, leaving the swap flag down, meaning we can stop the algorithm early.
Brandon Sandoval
I can see that now that I rewatched that part
@Asbjørn Grandt Hehe...it's because already knew the list was sorted! How? The last pass it performed was: "Swap 1 2? No. Swap 2 3? No." If it's all no's, all the smaller elements are already on the left, and the bigger ones on the right, meaning that the list is already sorted.
Eh, problem is the robot's movement takes time, which is not true when sorting something with random access. Somewhat comes back when you think about cache misses, but still. The memory itself is random access.
Look at him go :D all the way to the end. Give it up buddy
how dare you you talk to a robot who is physically and mentally handicapped. TAKE IT BACK
The year is 2020 and the bubble bot is still sorting the balls
Bogosort is also a very great sort, it can sort completely randomised stack in one move!
If you're astronomically lucky
Give those robots already sorted data and we will see who is better ;-)
One pass of Bubble Sort can still be useful for simulations involving raytracing. What else can it be used for? I invite replies of your answers.
Very original and well done !
泡沫排序法:找到最亮的球,然後排到最亮的位置;接著找到次高的球,然後排到次亮的位置。重複以上步驟直到排完最暗的球。
快速排序法:隨機選出一個球當作基準,然後比較每一顆球,比基準亮的球移到亮邊,比基準暗的球移到暗邊,最後的空位就是基準的位置。排完後排列被分成兩個較小的排列,分別對較小的排列重複以上步驟直到排完。
ok
hey can you visualize how radix base 10 just pulls an already sorter array out of the next dimention
This video is so helpful! Thank you!
This was so cute, it made me cry, thank you
Cool, but is it fair to include the time of the robots traveling since in reality the code/sorting algorithm would not require the robots to move and they would essentially be at the same place solely depending on how many comparisons they had made.
Sorting algorithms performance can be evaulated according to several criteria. Comparisons may be the most important one, but there are others, e.g., swaps (memory writes). Also, if the algorithm moves around a lot it can impact performance, since a computer's memory is usually optimized for speed assuming the program accesses close locations. If it jumps around it becomes slower (this is only true if the sorted list is really big). Anyway, the video mainly focuses on comparisons, like you say. The robot moving slows them down a bit, but doesn't effect the end result.
What about Cocktail Shaker Sort?
If you overclocked Bubble’s reduced instruction set, he could win.
These cute fellows are making things simple, abstract and adorable ❤️👍
all heroes don't wear capes...you guys are one of them....thank you soooo muchhhhh...!!
Awesome animations! Hoping you could make videos on other sorting algorithms.
Though people might have mistaken that quicksort is just slightly quicker than bubble sort from this animation because you only showed it on 10 items.
But in reality, quicksort can be tremendously quicker if the number of items is in order of millions or billions. It can mean that bubble sort uses a year while quicksort uses 10 minutes.
Right you are. There's a visualization of this difference you mention in a more recent video (near the end): th-cam.com/video/TZRWRjq2CAg/w-d-xo.html
“The End. Thank you for watching” before bubble sort taking a break...funny, and cruel.
Great animation. Had me smiling throughout the entire video. Thanks for uploading. :-)
so this is how robots keep themselves entertained
There are several different pivot rules for quick sort, such as random pivot you used, first pivot, last pivot, middle pivot and median of three (median of first, middle and last pivot).
Great video and animation
Bubble sort robot is doing his best
Hello, old me
god, I hate how these are 'intuitively' explained. By using the simplest explanation they think it makes it more 'palatable', but what really happens is the parameters are not understood and the example is lost. When someone hears the example "The robot has short vision", their immediate thought would be "Well why don't they make a robot that can see all the balls clearly?"
Nice video with clear demonstrations.
This deserves 500M, not 500k views
One of these days I’ll be able to comfortably watch this video with a straight face.
Bogo sort represents:"eternity"
Stooge sort represents:"shorter than eternity"
Bubble sort represents:"patience"
Quick sort represents"HURRY UP"
Would love to see a video on bogo sort