Тёмный

Sorting Algorithms (Bubble Sort, Shell Sort, Quicksort) 

White Chaddar
Подписаться 6 тыс.
Просмотров 2,1 млн
50% 1

A visualization of the following sorting algorithms:
* Bubble Sort
* Shell Sort (Donald Shell, 1959)
* Quicksort (Tony Hoare, 1960)
Music by Chris Zabriskie ( / chriszabriskie )

Наука

Опубликовано:

 

29 авг 2014

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 1,2 тыс.   
@YOM2_UB
@YOM2_UB 5 лет назад
"Bubble sort, 12500 values" ... ... ... Has it started?
@MisterTrayser
@MisterTrayser 5 лет назад
Same😂😂
@toddkes5890
@toddkes5890 4 года назад
watch the upper left corner ;)
@wichyousra
@wichyousra 3 года назад
i checked if i stopped the video turns out i didn t
@wichyousra
@wichyousra 3 года назад
honestly.. bubble sort was the most frustrating.. it makes me wanna crush that laying U shape (forgit it s name)
@layalsaleh4103
@layalsaleh4103 3 года назад
ikr
@AidenOcelot
@AidenOcelot 7 лет назад
Where's the bleep bloops!?
@nbshftr
@nbshftr 5 лет назад
AND THE RESOLUTION
@gwen6783
@gwen6783 4 года назад
AAAAAAA
@mycutepetshrimp1532
@mycutepetshrimp1532 4 года назад
Ikr
@lokhim711
@lokhim711 4 года назад
Bogo?
@yugodeandrawirayudha4908
@yugodeandrawirayudha4908 4 года назад
@@lokhim711 No, you know... That one video with white lines and some beep-boop-baps!
@aquawoelfly
@aquawoelfly 7 лет назад
bubble sort 12,500 digits me: im out
@ykl1277
@ykl1277 7 лет назад
It is beautiful to look at
@kleebgaming5209
@kleebgaming5209 7 лет назад
It's a great question, but it doesn't have an answer, at least not yet. But that's okay. Maybe 20 years from now someone uses this compound in a medical imaging device, or to aid in the treatment of raw sewerage, or as a precursor to a different compound that is useful. The thing about scientific discovery is that you don't really know beforehand if it's going to be a "useful" discovery or not. Not every scientific discovery is a "diamond in the rough", but when you do find your diamonds, it sort of justifies all of the lumps of coal you found as well.
@blacktrooper100
@blacktrooper100 7 лет назад
I believe a logarithm is what you are thinking of
@freshrockpapa-e7799
@freshrockpapa-e7799 7 лет назад
It could also be e to a negative function.
@iskatelikeanoob
@iskatelikeanoob 7 лет назад
would make a good screen saver
@satyrkrieg
@satyrkrieg 7 лет назад
Even if it's the worst, bubble sort is the most beautiful to watch. It was kinda like nature, so soothing.
@vincentbuscarello1357
@vincentbuscarello1357 7 лет назад
slow =/= worst, all depends on the application
@tylisirn
@tylisirn 7 лет назад
Not really... Bubble sort has only two redeeming features, it's dead simple to implement, and it's a stable sort (won't change order of elements that are equal). And for both of those there are algorithms that strictly better. Even if just cocktail sort (bi-directional bubble sort), which is just as easy and converges on average twice as fast. But I have to admit that I have used bubble sort in the past when I haven't been able to use a ready made library algorithm for one reason or another, because unless you dataset is large (and I know it will never be large), it often makes little practical difference on modern machines whether your sort finishes in 1 microsecond or 100 microseconds. Even a set like 10 000 elements is "only" 100 million iterations and my desktop can churn a cool 300 billion operations a second. (Qsort average case is NlogN operations, or about 100 000)
@manantank
@manantank 5 лет назад
Bubble sort is a disgrace to sorting.
@hanss3147
@hanss3147 5 лет назад
Mergesort best sort
@SusAmongUsSusImpostor
@SusAmongUsSusImpostor 5 лет назад
Yeah well I just want it to stop getting into my recommended
@petrusion2827
@petrusion2827 5 лет назад
I'm a high school programming student. The other day I tried to make both bubble sort and quicksort for some practice and measured their times for fun. I was blown at how much the difference actually was - Bubble took *7 minutes* while Quick took *115ms* . This video proves to me I didn't measure it wrong.
@jmiller6066
@jmiller6066 2 года назад
Radix sort is even faster still, the caveat is you can only use it with numeric values.
@ericrossi7039
@ericrossi7039 2 года назад
@@jmiller6066 Can’t radix sort be used with strings using the ASCII values for the characters?
@juliaf_
@juliaf_ 2 года назад
@Kimmy Anfo other options: bad computer, using a browser shell and the internet is bad, slight implementation error
@supe4701
@supe4701 2 года назад
@Kimmy Anfo You do know he was saying saying 115 milliseconds as in 0.115 seconds, right?
@feritperliare2890
@feritperliare2890 2 года назад
@@ericrossi7039 the point is that redix sort doesn't actually compare values and more like recreates them so you can't use redix sort for objects and those sort of things
@Qbe_Root
@Qbe_Root 8 лет назад
I don’t know why the dotted representation isn’t used more in sorting algorithm videos. In the case of the quicksort, it’s way clearer than the lines.
@PattyManatty
@PattyManatty 8 лет назад
And it just made the bubble sort animation look soooooooooooooooooooo cool
@klobiforpresident2254
@klobiforpresident2254 8 лет назад
I completely agree. Not just does it carry the same information (value and list position) but is an easy way to visualize it. You can easily see how every, at least seems to, work. I didn't think of bubble sort as the algorithm to create such a curved line but it makes sense in retrospect. This is also great at showing the difference between such things as merge and shell or bubble and cocktail shaker. Well, if you use it with bongo it's still pointless. I love my teacher's explanation. "Imagine you have a deck of cards. Shuffle the on he table. Set the house on fire and collect the cards when they fly out. If they're not sorted, try it with the neighbors house. If your cards all burn that just means there's nothing left to sort - you did it."
@groszak1
@groszak1 8 лет назад
For some algorithms, lines are clearer. For example if you want to find the value of the rightmost element of unsorted array.
@gmc_
@gmc_ 7 лет назад
Klobi for President b
@klobiforpresident2254
@klobiforpresident2254 7 лет назад
George M wut?
@hdckighfkvhvgmk
@hdckighfkvhvgmk 5 лет назад
6:18 hey look, it's me
@brkmnly
@brkmnly 3 года назад
Pog
@whateverthisis4087
@whateverthisis4087 3 года назад
Pog
@auriidraws5563
@auriidraws5563 3 года назад
Pog
@normalcore.
@normalcore. 3 года назад
Pog
@auriidraws5563
@auriidraws5563 3 года назад
Pog
@Ghiosh
@Ghiosh 7 лет назад
I don't know why I'm even here but I kinda like it.
@rafaxsworld
@rafaxsworld 7 лет назад
we are two...
@dascorncakes1151
@dascorncakes1151 7 лет назад
too*
@sallovic5890
@sallovic5890 7 лет назад
Corncakes Meme two was right you moron
@dascorncakes1151
@dascorncakes1151 7 лет назад
No it wasn't, two means 2 which is a unit of measurement, too means "as-well" such as "me too" "I am too" " you are way too edgy" or not "You two need to go home" or "me two" doesn't work because you are only one person. In order to use "two" properly in that regard, it require you to rephrase the sentence such as "That makes two of us" or "Count me as two".
@dascorncakes1151
@dascorncakes1151 7 лет назад
He meant "we are too" and was using "We" to refer to me, you and all who share the same thought, not himself therefor. You can't refer to yourself as "we" so therefor he was refering to people like you and me, thus not being "two"...
@mmmmmmmmmmmmmmmmmmm234
@mmmmmmmmmmmmmmmmmmm234 5 лет назад
So I actually just watched over 12 minutes of dots trying to get in line.
@dhonnano7417
@dhonnano7417 3 года назад
Yes
@user-vm1hi7bo5s
@user-vm1hi7bo5s 2 года назад
Not only dots but lines buidling smooth cliff :)
@OrchidAlloy
@OrchidAlloy 8 лет назад
Bubblesort in the 12,500 sorting was... kind of very beautiful.
@klobiforpresident2254
@klobiforpresident2254 8 лет назад
Just don't try that at home. It will create a black hole in your Computer. It *can't* be that slow ... well, yeah, I know it is.
@Collazoo
@Collazoo 6 лет назад
Samrux 100th like :)
@Jaylio
@Jaylio 6 лет назад
I think the shellsort one was the prettiest
@MistahGamah
@MistahGamah 5 лет назад
Samrux Rotate the screen, and the points look like bubbles rising to their proper location. Wow I wonder why
@comicsansgreenkirby
@comicsansgreenkirby 4 года назад
The universe disappearing from existence?
@ThePC007
@ThePC007 7 лет назад
I don't even want to know how much time bogo sort would need for the 1,200 values...
@-yttrium-1187
@-yttrium-1187 7 лет назад
ThePC007 You would need, on average, 1200^1200 tries to get the right answere. You would also need to check wether the sort has been succesfull. half the time, 1/2, the first two numbers do not match up costing 1 comparison, 1/4 of the sorts will have at least the first two numbers lined up costing two comparisons, 1/8 of the sorts will have the first 3 lined up, costing 3 comparsons and so on. This series converges to 2 comparisons on average. Which means that you would need around 1200^1200*2 comparisons to complete this series. This number is larger than a googleplex and if you forced every computer on this planet to perform this calculation untill the heat death of the universe and you still wouldn't be finished.
@sabhrant5533
@sabhrant5533 7 лет назад
ThePC007 around 1200! comparisons 😛
@abstractrussian5562
@abstractrussian5562 7 лет назад
Optimized bogosort will end at O(N log N), including bad cases too.
@liegegaia8376
@liegegaia8376 7 лет назад
Actually, because Bogo is completely random, the time you spend could range anywhere from 0 to infinity. There is still a chance Bogo sort can complete it, albeit very miniscule. You could be lucky enough and get it on your first try. Or you could be unlucky and never get it. With probability there is no certain amount of times it would take.
@rayzecor
@rayzecor 7 лет назад
+Yttrium it's not squared.It's factorial, that's far worse.
@Mikowmer
@Mikowmer 5 лет назад
The visualisation with the dots really helped me to understand how quicksort actually worked. Without the bars it just seemed to make so much more sense.
@BigFatWedge
@BigFatWedge Год назад
you take the box and split it into smaller boxes, see, and then you're done.
@slaction
@slaction 8 лет назад
My boy bubble sort has got this one.
@klobiforpresident2254
@klobiforpresident2254 8 лет назад
While we watch bubble sort, can I order pizza? I'm literally starving.
@betterrobots
@betterrobots 8 лет назад
Large set bubble sort is beautiful - i suspect also there are a ton of really interesting mathematical and geometric learnings to be had from the study of that curve.
@lemonscarfsourwool7541
@lemonscarfsourwool7541 5 лет назад
Chris Coreline try radix lsd base 10
@nejlaakyuz4025
@nejlaakyuz4025 5 лет назад
It looks like ln curve
@happypiano4810
@happypiano4810 2 года назад
Correct.
@moner65
@moner65 7 лет назад
Although the bubble sort algorithm was terribly slow, I liked watching it sort the 12,500 integers. So cool how it bent the line slowly. Nice video.
@Setras
@Setras 7 лет назад
The video speed when the last bubble sort occured was sped up by like 1000 times.
@janmamu8721
@janmamu8721 2 года назад
If you look at the black part of bubble sort, it looks a lot like gravity sort.
@xeridea
@xeridea 2 года назад
Bubble sort time scales exponentially, so any reasonably sized set will be horribly slow. It is the fastest sort for tiny sets, like less than 10 numbers, so it does have niche uses, or as the final part of some other sorts. Check out the O(n) time complexity of other sorts.
@spackseries4400
@spackseries4400 6 месяцев назад
​@@Setrasand I sped it up a whole 4x on top of that and it was by miles the slowest one
@nullyberd
@nullyberd 7 лет назад
bubble sort may be slow as shit but damn if it isn't relaxing to watch this visualization of it. it looks like a star field.
@realflow100
@realflow100 7 лет назад
IKR!
@sihya
@sihya 7 лет назад
Too trippy for me. Had to look away lol
@davecrupel2817
@davecrupel2817 6 лет назад
Tebrehs pussy xD
@estuardomachado7894
@estuardomachado7894 5 лет назад
Isaac Boates nope ajakaj
@k_tess
@k_tess 5 лет назад
Bogobogosort.
@AsaGayle
@AsaGayle 8 лет назад
Thank you for fast forwarding that bubble sort at the end lmao
@tejaschavan5235
@tejaschavan5235 6 лет назад
I dont think its fast-forwarded haha..it has to deal with lesser numbers so it seems faster..but its just proportional
@DavidThomas005
@DavidThomas005 6 лет назад
The values are slowly put onto their general area so it has a much faster effect at the end.
@draconis17
@draconis17 6 лет назад
He means the ENTIRE bubblesort at the end, as in the bubblesort with 12500 numbers. The one where the creator fast-forwarded and put a fast-forward symbol in the corner of the screen.That probably would've taken like an hour without it. Probably much longer actually.
@nsq2487
@nsq2487 5 лет назад
@@draconis17 Not without this visualisation. A computer can perform tens of thousands of comparisons a second. It will spit out the sorted array in seconds. It's only taking long because there is a delay set between each comparison for demonstration purposes. In real world application, the time difference between using bubble sort and quick sort on 12,500 items is inconsequential.
@willb5278
@willb5278 5 лет назад
12500 integers? Sure, do the same for more complex comparisons like strings and you're in for a world of pain.
@SKyrim190
@SKyrim190 7 лет назад
Bubble sort seems to draw a logarithm curve when sorting all those 12,000 elements. I wonder why...
@katzen3314
@katzen3314 7 лет назад
Is it actually a log curve?
@dexterovski
@dexterovski 7 лет назад
Rudi Visagie wtf are you talking about? He didn't talk about time complexity.
@FutureAIDev2015
@FutureAIDev2015 7 лет назад
He's talking about the emergent pattern of the top edge of the data as it's being sorted. It looks like a logarithmic function.
@erikj5308
@erikj5308 7 лет назад
The low end of it gets close to being sorted quickly while the other stuff doesn't get close until later.
@reubenfrench6288
@reubenfrench6288 7 лет назад
I didn't even think about log. My mind was gravitating toward exponential or inverse.
@mcechss
@mcechss 7 лет назад
Am I the only one who did bubble sort manually with a set of playing cards just to see how slow it was compared to how I normally sort cards? (It took 44 min. 41.89 sec. by the way, I have no life)
@mrmastaofdesasta6994
@mrmastaofdesasta6994 6 лет назад
How does it take you so long? It takes me well below 5 minutes while watching videos. Maybe i got something wrong though...
@mrmastaofdesasta6994
@mrmastaofdesasta6994 6 лет назад
Yeah, I did something wrong. First I sorted it by colors, then i used bubblesort.
@yukin2344
@yukin2344 6 лет назад
wtf 😂
@destroyer2496
@destroyer2496 6 лет назад
I think you need to use counting sort (use values as parameter) since you have unlimited memory
@hanro50
@hanro50 6 лет назад
Bubble sort can be pretty easy and resource intensive to program so it balances out.
@papyfun5097
@papyfun5097 3 года назад
Just realized that the comments I was reading were 4-5 years ago and im here when this video is 6 years old
@ThereWasNoFreeName
@ThereWasNoFreeName 9 лет назад
From this visualization i can clearly tell what with large sets of data bubble sort is just useless, and the winner is quick sort. Not because it's "quick", but because the way it looks like. May look simple, but that algorythm clearly tell by itself: NOW! MULTITHREAD ME! DO IT! You can't run bubble or insertion or selection, but quick sort is easy to split and run in multiple threads.
@stefanalecu9532
@stefanalecu9532 8 лет назад
+ThereWasNoFreeName but timsort is the fastest, and python and java 7 have this sorting algorithm as the default one
@whitechaddar
@whitechaddar 8 лет назад
+Stefan Alecu Timsort is a hybrid sort (merge sort and insertion sort). The goal is to understand the individual algorithms and their strengths and weaknesses. After that, any combination of algorithms can be combined, such in the case of Timsort. Watch for more sorting videos on my channel in the future!
@stefanalecu9532
@stefanalecu9532 8 лет назад
cparsons2005 i am surprised that you responded. yes, i know that it's a hybrid sort. also, why don't you use sound of sorting? you can find it on panthema.com
@whitechaddar
@whitechaddar 8 лет назад
+Stefan Alecu I'm surprised I responded, too...I'm pretty busy most of the time and generally don't have a lot of time for commenting and replying (but I'm trying to find more time, lately). The reason I point out it's a hybrid sort is that my channel is geared towards educating and informing. So, my goal is to introduce the non-hybrid sorts and attempt to show the various strengths and weaknesses of each. After that, we can work on improving them by creating hybrid sorts (such as Timsort). As far as not using the sound of sorting, I haven't heard of it, before, but I like developing and creating my own things (which is most of the fun, for me).
@tobymardlin5448
@tobymardlin5448 8 лет назад
+ThereWasNoFreeName honestly you could easily multithread any of them by just splitting the dataset up, sorting in sections, then doing a very fast merge sort to recombine them at the end
@froglasers
@froglasers 4 года назад
Give me a second, just sorting all of these sorting videos into my sorting playlist for further sorting later
@magspie04
@magspie04 3 года назад
The algorithm keeps putting sorting algorithms in my recommended and I'm very confused but the videos are interesting so its chill.
@sstonergang69brr17
@sstonergang69brr17 4 года назад
I watched *_one_* of these sorting vids now they’re everywhere
@Unbridled-Whimsy
@Unbridled-Whimsy 4 года назад
Ikr it's annoying me to death. Get tf out of my recommended!!
@NK-ds8qo
@NK-ds8qo 2 года назад
I remember my CS Teacher showing us this video in a lesson probably in year 8 or 9 of high school. Now coming back here when I’m approaching the end of my CS A Level in year 13, having gained a much better understanding of these algorithms. Life is crazy.
@rafeverao4105
@rafeverao4105 7 лет назад
The bubble sort is extrememely slow, but it's beautiful to watch it work, and struggle with big numbers.
@gisibah
@gisibah 7 лет назад
the shell sort in this video is actually comb sort. notice how there are never more than two sorting lines.
@heliotype9591
@heliotype9591 3 года назад
I am 1000% fascinated with this ever since it showed up on my feed yesterday
@SomeoneCommenting
@SomeoneCommenting 5 лет назад
That super slow end bubble sort is beautiful to watch anyway. It had its purpose in the universe after all :-)
@Gautmeister
@Gautmeister 7 лет назад
Read "snorting algorithms"... This was a dissapointment
@barnabyroberts7950
@barnabyroberts7950 6 лет назад
Gaute Hermansen watch the first one with the dots and you’ll see why
@voxorox
@voxorox 5 лет назад
Now I really want to see a Bubble Snort algorithm.
@yanadnadya
@yanadnadya 3 года назад
S n o r t
@romeokilo125
@romeokilo125 9 лет назад
I LOVE this video! Especially the segment with the larger sets of data. I've been trying to visualize quicksort for awhile now (I keep losing track of the recursion) this painted it perfectly for me!
@whitechaddar
@whitechaddar 9 лет назад
Thank you! I'm glad this helped!
@abdur1996
@abdur1996 5 лет назад
I cant build many of them but I can Identify all of them by sound, this will come in handy during a job interview
@edgeeffect
@edgeeffect 8 лет назад
The bubble is by far the prettiest... shame it's no so good at actual practical sorting. Still, the only sort that my CS teacher managed to explain to us all at school.
@dorukayhanwastaken
@dorukayhanwastaken 7 лет назад
because it's ridiculously simple
@nok9355
@nok9355 5 лет назад
and some scripts can't do the others so bubble and sometimes heap is what they use
@Scudmaster11
@Scudmaster11 Год назад
​@Doruk Ayhan so is insertion... yes bubble is extremely simple... but it does alot of comparing
@MrBisiek
@MrBisiek 7 лет назад
Well, the second part was definitely best sorting algorithm visualization I've ever seen.
@rezigggg
@rezigggg 6 лет назад
I literally know nothing about algorithms beyond what they are but now I've been watching sorts for the past 30 minutes bc it's relaxing as hell
@konraddromero
@konraddromero 3 года назад
I love this because this is an excellent visual of each algorithm. I didnt even know that these existed, but I feel like I've learned something today so thank you.
@yordansic
@yordansic 6 лет назад
These would honestly make really good screensavers.
@jacksonb8123
@jacksonb8123 5 лет назад
Thank you RU-vid recommendations, very cool
@EvilSandwich
@EvilSandwich 3 года назад
No love for Merge sort or Cocktail Shaker sort? Those are my favorites. Cocktail Shaker Sort is so cool to watch.
@EnragedSephiroth
@EnragedSephiroth 7 лет назад
Quicksort is how I sort paperwork by date.
@mateuszodrzywoek8658
@mateuszodrzywoek8658 4 года назад
I sort with radix LSD base 10
@PaleOrchid
@PaleOrchid 4 года назад
@@mateuszodrzywoek8658 I always sort radix MSD base 10 because unlike computer, in life we cost more time to access far array than near one
@skinkrackz
@skinkrackz 7 лет назад
conclusion: bubble sort is ass
@suplerb
@suplerb 7 лет назад
Griffin Durning its seems slowed down, my own bubble sort interpretation is way faster
@davecrupel2817
@davecrupel2817 6 лет назад
Griffin Durning bubble ass? OuO
@toddkes5890
@toddkes5890 6 лет назад
Stooge Sort is even slower. Stooge sort sorts the top 2/3 of a list, then the bottom 2/3, then the top 2/3 again.
@dlwatib
@dlwatib 9 лет назад
Very nice visualization. And thanks for sorting the exact same datasets. But it needs to be paired with some comparison and swapping or data access statistics.
@whitechaddar
@whitechaddar 8 лет назад
+dlwatib I agree about the additional stats. I'm working on some new videos to explain these (and other) algorithms in a better way. I'm including comparison/access stats in those videos. Hopefully I'll be able to start publishing those in the near future!
@TERRORSTORM096
@TERRORSTORM096 Год назад
Why is the shell and quick sort so beautiful to look at, they look like stars in a vast galaxy.
@leonwang3072
@leonwang3072 5 лет назад
Bubble Sort is absolutely the winner. How beautiful
@michaltomek7889
@michaltomek7889 5 лет назад
I will send this video to friend who told me bubble sort is quick enought for all aplications :D :D
@reddragonflyxx657
@reddragonflyxx657 8 лет назад
Do you have source code available for this? I'm interested in how you did the visualization of the list. Either way it's impressive.
@teclinsoro4523
@teclinsoro4523 3 года назад
i am now addicted to sorting algorithm videos
@mau2713
@mau2713 6 лет назад
I think the creator thought he’s gonna show something interesting to people who actually care but 99% of people are just awake at 3am and have nothing better to do
@ScbSnck
@ScbSnck 4 года назад
Others: discussing algorithms Me: where is funny sounds?
@LinhThaiMy-cn2tn
@LinhThaiMy-cn2tn 5 лет назад
6:38 ah, yes i wondered where my sprinkles went This was pretty relaxing though
@basse9914
@basse9914 5 лет назад
There's always that one sort that wants to be a bubble sort when it grows up. It may be slow, but it's simple and wholesome.
@ankushbisen1185
@ankushbisen1185 2 года назад
7 years late but still fascinating
@thehighlandchannel1055
@thehighlandchannel1055 5 лет назад
*welcome to the next episode of why was this in my recommended*
@Runalotski
@Runalotski 9 лет назад
Would be nice to know how much the Bubble Sort was speeded up by. Thanks for the visualisations
@boi829
@boi829 4 года назад
i'm glad there were explanations for how the algorithms work
@Nw7usUs
@Nw7usUs 9 лет назад
Superb demonstration of these three sorting algorithms.
@alasdaresineaeris2772
@alasdaresineaeris2772 4 года назад
Looking for an algorithm to sort out my life
@user-vm1hi7bo5s
@user-vm1hi7bo5s 2 года назад
Hаve yоu triеd bоgо sоrt?
@alasdaresineaeris2772
@alasdaresineaeris2772 2 года назад
@@user-vm1hi7bo5s No luck yet, still waiting for that one to finish
@user-vm1hi7bo5s
@user-vm1hi7bo5s 2 года назад
@@alasdaresineaeris2772 Some say it will take the whole life or so
@fuzzydark1395
@fuzzydark1395 5 лет назад
i'm pretty new on programming world, but i wanted to know how do you make the computer to take it's time when sorting, i mean, normally it would do it within a second or less....
@pierrej9801
@pierrej9801 5 лет назад
i don't think you realize how many operations the computer does, just to sort an integer array. :). Some programs need more than hours to finish ^^
@joshuagollaher9614
@joshuagollaher9614 4 года назад
An average computer could bubble sort 12,500 numbers in under 100 milliseconds
@babyhermitcrab5114
@babyhermitcrab5114 3 года назад
Everyone says that bubble sort is slow, but nobody says that bubble sort is trying
@jess.hawkins
@jess.hawkins Год назад
A new level of visualisation of how bloody slow bubble sort really is!
@6Twisted
@6Twisted 7 лет назад
Does anyone know the actual name of the first song, not just the artist?
@epicormic_bud
@epicormic_bud 7 лет назад
THIS
@ThiscouldbeaName
@ThiscouldbeaName 7 лет назад
6Twisted Its called "Wonder Cycle"
@casimirthethird6377
@casimirthethird6377 5 лет назад
Darude - sandstorm
@firefly618
@firefly618 7 лет назад
I'd love to see a Quicksort that takes a bit more time to figure out the best pivot (sampling a few random values from the array and taking the median) and then delegates to Bubble Sort when the array is shorter than a given constant. I have a feeling that would be very fast!
@illuminalist
@illuminalist 7 лет назад
Sampling random value is a good way to find a pivot. But bubble sort is one of the slowest among the simple sort. In fact, there's timsort which is hybrid between mergesort(stable, no slow down from bad pivot) and insertion sort(quickest simple sort) to do the job in python programming language.
@chickenfarmer321
@chickenfarmer321 3 года назад
Bubble sorting seems like it would be great for low-end computers, with not a lot of processing power.
@angela_jx
@angela_jx 2 года назад
Wow the dotted visualization is one of the best I’ve seen of how divide and conquer works
@wayne5824
@wayne5824 5 лет назад
So there’s no funky sounds for this one.........
@Zdrowy9966
@Zdrowy9966 7 лет назад
There is something strangely intriguing about this video...
@MrHatoi
@MrHatoi 6 лет назад
That part at the end of bubble sort is so satisfying.
@elweewutroone
@elweewutroone 3 года назад
Everybody gangsta until the stars are being sorted
@Leeki85
@Leeki85 2 года назад
There's a mistake. You've used Comb Sort instead of Shell Sort. Comb Sort uses Bubble Sort that compares elements from far apart, while Shell Sort uses Insertion Sort for this. Both are similar, but have different optimal gap values. Comb Sort does more passes and the gap value shrinks slower, while Shell Sort takes more time for each pass, but a sub-sequences are sorted, so gap value can shrink faster.
@kxtbit
@kxtbit 10 месяцев назад
that’s what i thought too, guess that means i’m a sorting algorithm nerd lol
@steliostsoumas
@steliostsoumas 7 лет назад
I don't know anything about algorithms. But is so cool 😎
@buddette5513
@buddette5513 5 лет назад
them: what music do you listen to? me: it's complicated
@xanderbriggs2794
@xanderbriggs2794 3 года назад
Shell sort looks like a galaxy forming and then getting squished.
@suplerb
@suplerb 7 лет назад
Is the bubble sort slowed down?
@niknak_game
@niknak_game 7 лет назад
lol nope, it's just bad
@suplerb
@suplerb 7 лет назад
I must have done something wrong then, my bubble sort can do it in less than a second. I will look into it
@niknak_game
@niknak_game 7 лет назад
Oh, the visualizations are all slowed down by the same factor. I thought you meant is it slowed down relative to the other sorts.
@illuminalist
@illuminalist 7 лет назад
You have to test with a million of objects and hundreds of iterations. You will find it very slow compare to more advance algorithms.
@firefly618
@firefly618 7 лет назад
The 12k Bubble Short might have been speeded up, if anything. It's supposed to take ages on such large inputs. The flashing ">>" hints just that.
@39cluesfan
@39cluesfan 7 лет назад
u dont skip sorting algorithms DansGame
@stpedro-ht9ng
@stpedro-ht9ng 2 года назад
This is hypnotizing. Algorithms are fascinating. Been obsessed with them lately as i've been trying to learn how to code from a very theoretical low-level fundamental perspective. Always wanted to learn to program as a kid and feel more in love with music but the comp sci bug is biting back again.
@zachnunes123456789
@zachnunes123456789 8 лет назад
this was really pleasing to watch..
@King-xx6vz
@King-xx6vz 7 лет назад
Watched the whole video and I feel smarter now
@Yizak
@Yizak 7 лет назад
Oddly satisfying
@screengames5307
@screengames5307 7 лет назад
picture checks out.
@Aranimda
@Aranimda 2 года назад
I like Shell Sort because it very early shows an estimate of the final result.
@Tenteono
@Tenteono 5 лет назад
I really like that you included descriptions.
@FutureAIDev2015
@FutureAIDev2015 7 лет назад
Bubble sort DOES suck! 😁
@want-diversecontent3887
@want-diversecontent3887 7 лет назад
Matthew Ferrie But it's not the worst. STOOGE SORT
@thatoneguy9582
@thatoneguy9582 7 лет назад
Raffy Tabingo Bogo sort m8
@exe-rh3hx
@exe-rh3hx 5 лет назад
How about bogo sort?
@LAvocat
@LAvocat 7 лет назад
Wow, je sais pas si je suis le seul Fr ici, mais ce que je sais, c'est que c'est hyper cool !
@ReasonMakes
@ReasonMakes 7 лет назад
L' Avocat Ouais... Trés cool :)
@sebastienberger2890
@sebastienberger2890 5 лет назад
Non
@PlutoDarknight
@PlutoDarknight 3 года назад
Watching sorting algorithms is kind of satisfying
@Nathaniel215
@Nathaniel215 6 лет назад
I dont know why but... this is so satisfying!
@blechdose3234
@blechdose3234 7 лет назад
Trust me, LSD makes it even nicer!
@kikispantig
@kikispantig 6 лет назад
Ste fan Yeah. I can see some straightforward lines forming and unite. (If he uses dot graph like these) If it also has sound it might be epic to listen!
@pikksen7905
@pikksen7905 5 лет назад
kozirizu *HAIL BASE TEN, GOD OF SOUNDS*
@CaveyMoth
@CaveyMoth 5 лет назад
I love LSD! It's a fun videogame!
@reladox8517
@reladox8517 6 лет назад
Why on earth would anyone use bubble sort???
@toddkes5890
@toddkes5890 6 лет назад
They learned it from their Computer Science 101 book and it is fairly easy to code. Comb sort would be much faster and only need an extra IF loop though. Bubble sort is slow because it only compares elements 1 apart (and small elements take a very long to get sorted to the beginning), Comb sort compares elements much farther apart, while Comb Sort starts a large distance apart (about 70% the size if the input), and steadily makes the distance smaller. For example, the Shell sort above actually appears to be a Comb Sort, as it appears to only compare pixels in two positions, while Shell sort would compare an array. Assuming the distance apart is 50, then Comb sort would compare 101 vs 151, 102 vs 152, 103 vs 153, aso. Shell sort would compare 1 vs 51 vs 101 vs 151 vs . . . ., then 2 vs 52, 102 vs 152, aso . . . Shell sort means the input data is divided into smaller arrays, and each of those arrays is in sorted order. But if programmers need a simple (and slow) sort, they could at least try cocktail shaker sort. First it does a Bubble sort to move the highest value to the end, then it does a 'bubble' array sort going from end to beginning to find the smallest item and move it to the beginning. Hope this helps.
@jamesking2439
@jamesking2439 6 лет назад
It's easy to write and understand. That said, quicksort is almost as easy to write and understand.
@Nukestarmaster
@Nukestarmaster 5 лет назад
If you think bubble sort is bad, you should see bogosort.
@franzjosephliszt1555
@franzjosephliszt1555 7 лет назад
all it takes is watching one of these motherfucking videos and then that's all youtube puts in your recommended. goddamnit
@mikewright7964
@mikewright7964 3 года назад
why are these so goddamn interesting to watch
@mightyd33r
@mightyd33r 7 лет назад
That moment when you realize Bubble and Shell sort are faster than quick sort
@ophello
@ophello 7 лет назад
These needed to be way way sped up. This did not need to be 12 minutes long. Would have been far more interesting to see it like 5-6 times faster.
@catprog
@catprog 5 лет назад
Very good visualization of quicksort (the 12,500 one) Really good for explaining what is going on.
@redgeoblaze3752
@redgeoblaze3752 7 лет назад
Aw, that's cute. Bubble is trying it's best.
@iamdan8203
@iamdan8203 3 года назад
Кто бы ни читал этот комментарий, знай, что *ГОСПОДЬ ИИСУС ХРИСТОС ЛЮБИТ ТЕБЯ!* Whoever reads this comment, know that *LORD JESUS CHRIST LOVES YOU!*
@user-ui4nn4lb6y
@user-ui4nn4lb6y 6 лет назад
It's the best visualization i've ever seen.
@rigzmoviediaries654
@rigzmoviediaries654 3 года назад
This video actually explains how sorting algorithms work and people call it boring.
@rsethc
@rsethc 2 года назад
I like this dot visualization a lot better than the bar graphs in most sorting videos, this gives more of an intuitive insight into why the algorithms are clever or in the case of bubble sort why it is so wasteful, from a spatial standpoint rather than just the abstract explanation.
@ExtremelyAverage1
@ExtremelyAverage1 2 года назад
How thee hell did youtube decide I needed this?
@Squishy_Oranges
@Squishy_Oranges 2 года назад
This feels nostalgic for some reason
@realflow100
@realflow100 7 лет назад
okay its obvious we all know. its very satisfying to watch the bubble sorting at the end of the video!
@sanket7402
@sanket7402 5 лет назад
Wow! Thank you so much... It makes me visualize about sorting algorithm which i didn't think about it before.
Далее
Visualizing 70 Sorting Algorithms
29:24
Просмотров 57 тыс.
Visualization of Radix sort
7:02
Просмотров 28 тыс.
Sinfdosh xotin 7😂
01:01
Просмотров 1 млн
СТРИМ ► Elden Ring - Shadow of the Erdtree #5
5:07:46
15 Sorting Algorithms in 6 Minutes
5:50
Просмотров 24 млн
sorting algorithms to relax/study to
58:05
Просмотров 2,7 млн
50+ Sorts, Visualized - Swirl Dots
28:44
Просмотров 831 тыс.
Neural Network Learns to Play Snake
7:14
Просмотров 4,5 млн
10 FORBIDDEN Sorting Algorithms
9:41
Просмотров 799 тыс.
Why do calculators get this wrong? (We don't know!)
12:19
In-Place LSD Radix Sort
13:11
Просмотров 116 тыс.
A problem so hard even Google relies on Random Chance
12:06
Quicksort: Partitioning an array
4:48
Просмотров 577 тыс.