Sorting Algorithms (Bubble Sort, Shell Sort, Quicksort)

Поделиться
HTML-код
  • Опубликовано: 18 ноя 2024

Комментарии • 1,2 тыс.

  • @YOM2_UB
    @YOM2_UB 5 лет назад +3144

    "Bubble sort, 12500 values"
    ...
    ...
    ...
    Has it started?

    • @MisterTrayser
      @MisterTrayser 5 лет назад +18

      Same😂😂

    • @toddkes5890
      @toddkes5890 4 года назад +31

      watch the upper left corner ;)

    • @wichyousra
      @wichyousra 3 года назад +8

      i checked if i stopped the video
      turns out i didn t

    • @wichyousra
      @wichyousra 3 года назад +9

      honestly.. bubble sort was the most frustrating.. it makes me wanna crush that laying U shape (forgit it s name)

    • @layalsaleh4103
      @layalsaleh4103 3 года назад +2

      ikr

  • @aquawoelfly
    @aquawoelfly 8 лет назад +4796

    bubble sort 12,500 digits
    me: im out

    • @ykl1277
      @ykl1277 8 лет назад +150

      It is beautiful to look at

    • @kleebgaming5209
      @kleebgaming5209 7 лет назад +33

      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 лет назад +26

      I believe a logarithm is what you are thinking of

    • @freshrockpapa-e7799
      @freshrockpapa-e7799 7 лет назад +4

      It could also be e to a negative function.

    • @iskatelikeanoob
      @iskatelikeanoob 7 лет назад +12

      would make a good screen saver

  • @AidenOcelot
    @AidenOcelot 7 лет назад +5384

    Where's the bleep bloops!?

  • @petrusion2827
    @petrusion2827 5 лет назад +323

    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 года назад +19

      Radix sort is even faster still, the caveat is you can only use it with numeric values.

    • @ericrossi7039
      @ericrossi7039 2 года назад +14

      @@jmiller6066 Can’t radix sort be used with strings using the ASCII values for the characters?

    • @juliaf_
      @juliaf_ 2 года назад +20

      @Kimmy Anfo other options: bad computer, using a browser shell and the internet is bad, slight implementation error

    • @supe4701
      @supe4701 2 года назад +8

      @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

  • @satyrkrieg
    @satyrkrieg 8 лет назад +3509

    Even if it's the worst, bubble sort is the most beautiful to watch. It was kinda like nature, so soothing.

    • @vincentbuscarello1357
      @vincentbuscarello1357 8 лет назад +156

      slow =/= worst, all depends on the application

    • @tylisirn
      @tylisirn 8 лет назад +192

      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 6 лет назад +35

      Bubble sort is a disgrace to sorting.

    • @hanss3147
      @hanss3147 6 лет назад +7

      Mergesort best sort

    • @SusAmongUsSusImpostor
      @SusAmongUsSusImpostor 5 лет назад +3

      Yeah well I just want it to stop getting into my recommended

  • @Qbe_Root
    @Qbe_Root 9 лет назад +2625

    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 лет назад +162

      And it just made the bubble sort animation look soooooooooooooooooooo cool

    • @klobiforpresident2254
      @klobiforpresident2254 8 лет назад +104

      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 лет назад +17

      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?

  • @Ghiosh
    @Ghiosh 8 лет назад +1053

    I don't know why I'm even here but I kinda like it.

    • @rafaxsworld
      @rafaxsworld 8 лет назад +17

      we are two...

    • @dascorncakes1151
      @dascorncakes1151 7 лет назад +4

      too*

    • @sallovic5890
      @sallovic5890 7 лет назад +17

      Corncakes Meme two was right you moron

    • @dascorncakes1151
      @dascorncakes1151 7 лет назад +5

      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 лет назад +2

      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"...

  • @OrchidAlloy
    @OrchidAlloy 8 лет назад +681

    Bubblesort in the 12,500 sorting was... kind of very beautiful.

    • @klobiforpresident2254
      @klobiforpresident2254 8 лет назад +52

      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 лет назад +2

      Samrux 100th like :)

    • @Jaylio
      @Jaylio 6 лет назад +3

      I think the shellsort one was the prettiest

    • @MistahGamah
      @MistahGamah 6 лет назад +2

      Samrux Rotate the screen, and the points look like bubbles rising to their proper location.
      Wow I wonder why

    • @comicsansgreenkirby
      @comicsansgreenkirby 5 лет назад +2

      The universe disappearing from existence?

  • @betterrobots
    @betterrobots 9 лет назад +182

    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.

  • @moner65
    @moner65 8 лет назад +432

    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 8 лет назад +12

      The video speed when the last bubble sort occured was sped up by like 1000 times.

    • @jan_Mamu
      @jan_Mamu 2 года назад +4

      If you look at the black part of bubble sort, it looks a lot like gravity sort.

    • @xeridea
      @xeridea 2 года назад +1

      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 11 месяцев назад

      ​@@Setrasand I sped it up a whole 4x on top of that and it was by miles the slowest one

  • @hdckighfkvhvgmk
    @hdckighfkvhvgmk 6 лет назад +642

    6:18 hey look, it's me

  • @mmmmmmmmmmmmmmmmmmm234
    @mmmmmmmmmmmmmmmmmmm234 5 лет назад +102

    So I actually just watched over 12 minutes of dots trying to get in line.

  • @nullyberd
    @nullyberd 8 лет назад +772

    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.

  • @Mikowmer
    @Mikowmer 6 лет назад +21

    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.

  • @ThePC007
    @ThePC007 8 лет назад +1125

    I don't even want to know how much time bogo sort would need for the 1,200 values...

    • @-yttrium-1187
      @-yttrium-1187 8 лет назад +256

      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 8 лет назад +57

      ThePC007 around 1200! comparisons 😛

    • @abstractrussian5562
      @abstractrussian5562 7 лет назад +19

      Optimized bogosort will end at O(N log N), including bad cases too.

    • @liegegaia8376
      @liegegaia8376 7 лет назад +134

      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 лет назад +53

      +Yttrium it's not squared.It's factorial, that's far worse.

  • @mcechss
    @mcechss 8 лет назад +462

    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 7 лет назад +20

      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 7 лет назад +42

      Yeah, I did something wrong. First I sorted it by colors, then i used bubblesort.

    • @yukin2344
      @yukin2344 6 лет назад +2

      wtf 😂

    • @destroyer2496
      @destroyer2496 6 лет назад +5

      I think you need to use counting sort
      (use values as parameter)
      since you have unlimited memory

    • @hanro50
      @hanro50 6 лет назад +1

      Bubble sort can be pretty easy and resource intensive to program so it balances out.

  • @AsaGayle
    @AsaGayle 8 лет назад +437

    Thank you for fast forwarding that bubble sort at the end lmao

    • @tejaschavan5235
      @tejaschavan5235 7 лет назад +37

      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 лет назад +6

      The values are slowly put onto their general area so it has a much faster effect at the end.

    • @draconis17
      @draconis17 6 лет назад +21

      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 6 лет назад +3

      @@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 8 лет назад +519

    Bubble sort seems to draw a logarithm curve when sorting all those 12,000 elements. I wonder why...

    • @katzen3314
      @katzen3314 8 лет назад +28

      Is it actually a log curve?

    • @dexterovski
      @dexterovski 8 лет назад +16

      Rudi Visagie wtf are you talking about? He didn't talk about time complexity.

    • @FutureAIDev2015
      @FutureAIDev2015 8 лет назад +182

      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 8 лет назад +51

      The low end of it gets close to being sorted quickly while the other stuff doesn't get close until later.

    • @reubenfrench6288
      @reubenfrench6288 7 лет назад +37

      I didn't even think about log. My mind was gravitating toward exponential or inverse.

  • @ThereWasNoFreeName
    @ThereWasNoFreeName 9 лет назад +888

    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 9 лет назад +12

      +ThereWasNoFreeName but timsort is the fastest, and python and java 7 have this sorting algorithm as the default one

    • @whitechaddar
      @whitechaddar  9 лет назад +99

      +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 9 лет назад +2

      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  9 лет назад +47

      +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 9 лет назад +12

      +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

  • @slaction
    @slaction 8 лет назад +70

    My boy bubble sort has got this one.

    • @klobiforpresident2254
      @klobiforpresident2254 8 лет назад +8

      While we watch bubble sort, can I order pizza? I'm literally starving.

  • @rafeverao4105
    @rafeverao4105 7 лет назад +38

    The bubble sort is extrememely slow, but it's beautiful to watch it work, and struggle with big numbers.

  • @gisibah
    @gisibah 8 лет назад +77

    the shell sort in this video is actually comb sort. notice how there are never more than two sorting lines.

  • @NK-ds8qo
    @NK-ds8qo 2 года назад +3

    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.

  • @romeokilo125
    @romeokilo125 10 лет назад +116

    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  10 лет назад +23

      Thank you! I'm glad this helped!

  • @froglasers
    @froglasers 4 года назад +4

    Give me a second, just sorting all of these sorting videos into my sorting playlist for further sorting later

  • @edgeeffect
    @edgeeffect 9 лет назад +84

    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 8 лет назад +14

      because it's ridiculously simple

    • @nok9355
      @nok9355 5 лет назад +1

      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

  • @magspie04
    @magspie04 3 года назад +3

    The algorithm keeps putting sorting algorithms in my recommended and I'm very confused but the videos are interesting so its chill.

  • @SomeoneCommenting
    @SomeoneCommenting 6 лет назад +3

    That super slow end bubble sort is beautiful to watch anyway. It had its purpose in the universe after all :-)

  • @papyfun5097
    @papyfun5097 3 года назад +4

    Just realized that the comments I was reading were 4-5 years ago and im here when this video is 6 years old

  • @babyhermitcrab5114
    @babyhermitcrab5114 4 года назад +2

    Everyone says that bubble sort is slow, but nobody says that bubble sort is trying

  • @abdur1996
    @abdur1996 5 лет назад +8

    I cant build many of them but I can Identify all of them by sound, this will come in handy during a job interview

  • @sstonergang69brr17
    @sstonergang69brr17 4 года назад +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!!

  • @MrBisiek
    @MrBisiek 8 лет назад +3

    Well, the second part was definitely best sorting algorithm visualization I've ever seen.

  • @ankushbisen1185
    @ankushbisen1185 3 года назад +1

    7 years late but still fascinating

  • @EvilSandwich
    @EvilSandwich 4 года назад +3

    No love for Merge sort or Cocktail Shaker sort? Those are my favorites. Cocktail Shaker Sort is so cool to watch.

  • @heliotype9591
    @heliotype9591 3 года назад +1

    I am 1000% fascinated with this ever since it showed up on my feed yesterday

  • @EnragedSephiroth
    @EnragedSephiroth 8 лет назад +44

    Quicksort is how I sort paperwork by date.

    • @mateuszodrzywoek8658
      @mateuszodrzywoek8658 5 лет назад +1

      I sort with radix LSD base 10

    • @PaleOrchid
      @PaleOrchid 4 года назад +2

      @@mateuszodrzywoek8658 I always sort radix MSD base 10 because unlike computer, in life we cost more time to access far array than near one

  • @rezigggg
    @rezigggg 7 лет назад +1

    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

  • @yordansic
    @yordansic 6 лет назад +12

    These would honestly make really good screensavers.

  • @JAz3
    @JAz3 4 года назад +2

    RUclips wont stop sending me these please

  • @Gautmeister
    @Gautmeister 8 лет назад +303

    Read "snorting algorithms"... This was a dissapointment

    • @barnabyroberts7950
      @barnabyroberts7950 6 лет назад +5

      Gaute Hermansen watch the first one with the dots and you’ll see why

    • @voxorox
      @voxorox 6 лет назад +1

      Now I really want to see a Bubble Snort algorithm.

    • @yanadnadya
      @yanadnadya 3 года назад

      S n o r t

  • @franzjosephliszt1555
    @franzjosephliszt1555 7 лет назад +2

    all it takes is watching one of these motherfucking videos and then that's all youtube puts in your recommended. goddamnit

  • @dlwatib
    @dlwatib 9 лет назад +15

    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  9 лет назад +5

      +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!

  • @MutantWyvern
    @MutantWyvern 2 года назад

    Why is the shell and quick sort so beautiful to look at, they look like stars in a vast galaxy.

  • @jacksonb8123
    @jacksonb8123 5 лет назад +6

    Thank you RUclips recommendations, very cool

  • @basse9914
    @basse9914 6 лет назад +1

    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.

  • @konraddromero
    @konraddromero 4 года назад +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.

  • @arthur6999
    @arthur6999 4 года назад +2

    imagine doing bogosort with 12500 values...

  • @LinhThaiMy-cn2tn
    @LinhThaiMy-cn2tn 6 лет назад +4

    6:38 ah, yes i wondered where my sprinkles went
    This was pretty relaxing though

  • @boi829
    @boi829 4 года назад +1

    i'm glad there were explanations for how the algorithms work

  • @michaltomek7889
    @michaltomek7889 6 лет назад +6

    I will send this video to friend who told me bubble sort is quick enought for all aplications :D :D

  • @jess.hawkins
    @jess.hawkins 2 года назад

    A new level of visualisation of how bloody slow bubble sort really is!

  • @ScbSnck
    @ScbSnck 4 года назад +3

    Others: discussing algorithms
    Me: where is funny sounds?

  • @angela_jx
    @angela_jx 2 года назад

    Wow the dotted visualization is one of the best I’ve seen of how divide and conquer works

  • @firefly618
    @firefly618 8 лет назад +15

    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 8 лет назад +10

      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.

  • @mau2713
    @mau2713 6 лет назад +1

    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

  • @thehighlandchannel1055
    @thehighlandchannel1055 5 лет назад +3

    *welcome to the next episode of why was this in my recommended*

  • @mytech6779
    @mytech6779 3 года назад +1

    Bubble is bad for big data, but is often fastest with very small data. Uses a fast instruction with low branch prediction misses and is cache friendly.

  • @reddragonflyxx657
    @reddragonflyxx657 8 лет назад +42

    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.

  • @leonwang3072
    @leonwang3072 6 лет назад

    Bubble Sort is absolutely the winner. How beautiful

  • @alasdaresineaeris2772
    @alasdaresineaeris2772 4 года назад +3

    Looking for an algorithm to sort out my life

  • @rigzmoviediaries654
    @rigzmoviediaries654 4 года назад +1

    This video actually explains how sorting algorithms work and people call it boring.

  • @zkinkrackz
    @zkinkrackz 8 лет назад +118

    conclusion: bubble sort is ass

    • @suplerb
      @suplerb 8 лет назад +2

      Griffin Durning its seems slowed down, my own bubble sort interpretation is way faster

    • @davecrupel2817
      @davecrupel2817 7 лет назад +4

      Griffin Durning bubble ass? OuO

    • @toddkes5890
      @toddkes5890 6 лет назад +2

      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.

  • @DrMJC13
    @DrMJC13 4 года назад +1

    After a hard days work it's time for some weekend fun...bubble sorting

  • @Runalotski
    @Runalotski 9 лет назад +5

    Would be nice to know how much the Bubble Sort was speeded up by.
    Thanks for the visualisations

  • @superfire6463
    @superfire6463 3 года назад +2

    People who didn’t watch on x2 speed, I admire and fear you

  • @steliostsoumas
    @steliostsoumas 7 лет назад +6

    I don't know anything about algorithms. But is so cool 😎

  • @nw7us
    @nw7us 9 лет назад

    Superb demonstration of these three sorting algorithms.

  • @Zdrowy9966
    @Zdrowy9966 8 лет назад +6

    There is something strangely intriguing about this video...

  • @teclinsoro4523
    @teclinsoro4523 3 года назад +1

    i am now addicted to sorting algorithm videos

  • @wayne5824
    @wayne5824 5 лет назад +4

    So there’s no funky sounds for this one.........

  • @Aranimda
    @Aranimda 2 года назад +1

    I like Shell Sort because it very early shows an estimate of the final result.

  • @39cluesfan
    @39cluesfan 8 лет назад +39

    u dont skip sorting algorithms DansGame

  • @Squishy_Orange
    @Squishy_Orange 3 года назад

    This feels nostalgic for some reason

  • @King-xx6vz
    @King-xx6vz 7 лет назад +4

    Watched the whole video and I feel smarter now

  • @guilhermecruz
    @guilhermecruz 7 лет назад

    Stop telling me to skip bubble sort!! It's so slow and yet so relaxing!

  • @6Twisted
    @6Twisted 7 лет назад +11

    Does anyone know the actual name of the first song, not just the artist?

  • @xanderbriggs2794
    @xanderbriggs2794 4 года назад +1

    Shell sort looks like a galaxy forming and then getting squished.

  • @fuzzydark1395
    @fuzzydark1395 5 лет назад +4

    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 лет назад +1

      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

  • @mrbrown6421
    @mrbrown6421 3 года назад +1

    11.25.2021
    Absolutely Beautiful in sound and math.

  • @Leeki85
    @Leeki85 3 года назад +3

    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 Год назад

      that’s what i thought too, guess that means i’m a sorting algorithm nerd lol

  • @chickenfarmer321
    @chickenfarmer321 3 года назад +1

    Bubble sorting seems like it would be great for low-end computers, with not a lot of processing power.

  • @LAvocat
    @LAvocat 8 лет назад +5

    Wow, je sais pas si je suis le seul Fr ici, mais ce que je sais, c'est que c'est hyper cool !

  • @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.

  • @FutureAIDev2015
    @FutureAIDev2015 8 лет назад +8

    Bubble sort DOES suck! 😁

  • @PlutoDarknight
    @PlutoDarknight 3 года назад

    Watching sorting algorithms is kind of satisfying

  • @reladox8517
    @reladox8517 7 лет назад +14

    Why on earth would anyone use bubble sort???

    • @toddkes5890
      @toddkes5890 6 лет назад +9

      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 лет назад +1

      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.

  • @MrHatoi
    @MrHatoi 6 лет назад

    That part at the end of bubble sort is so satisfying.

  • @suplerb
    @suplerb 8 лет назад +5

    Is the bubble sort slowed down?

    • @officialniknak
      @officialniknak 8 лет назад +8

      lol nope, it's just bad

    • @suplerb
      @suplerb 8 лет назад +2

      I must have done something wrong then, my bubble sort can do it in less than a second. I will look into it

    • @officialniknak
      @officialniknak 8 лет назад +28

      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 8 лет назад +2

      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 8 лет назад +4

      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.

  • @realflow100
    @realflow100 7 лет назад

    okay its obvious we all know. its very satisfying to watch the bubble sorting at the end of the video!

  • @mightyd33r
    @mightyd33r 7 лет назад +3

    That moment when you realize
    Bubble and Shell sort are faster than quick sort

  • @bredgamingleaf3478
    @bredgamingleaf3478 5 лет назад +2

    You should make a sorting algorithm to sort your sorting algorithms that sort your algorithms for sorting

  • @Yizak
    @Yizak 8 лет назад +6

    Oddly satisfying

  • @Axel-wo6qu
    @Axel-wo6qu 3 года назад

    I like how bubble sort is so slow at higher amounts that they both fast-forwarded and used I for credits at the same time

  • @iamdan8203
    @iamdan8203 4 года назад +5

    Кто бы ни читал этот комментарий, знай, что *ГОСПОДЬ ИИСУС ХРИСТОС ЛЮБИТ ТЕБЯ!*
    Whoever reads this comment, know that *LORD JESUS CHRIST LOVES YOU!*

  • @fernandoed1517
    @fernandoed1517 6 лет назад

    Thank God this one doesn't have painful sound

  • @blechdose3234
    @blechdose3234 8 лет назад +20

    Trust me, LSD makes it even nicer!

    • @kikispantig
      @kikispantig 6 лет назад +1

      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 6 лет назад +1

      kozirizu *HAIL BASE TEN, GOD OF SOUNDS*

    • @CaveyMoth
      @CaveyMoth 5 лет назад

      I love LSD! It's a fun videogame!

  • @sizzlet01
    @sizzlet01 2 года назад

    Bubble Sort: "No matter how hard you all try, you still come back to me."

  • @ophello
    @ophello 8 лет назад +5

    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.

  • @faustvolke
    @faustvolke 4 года назад +1

    I only watched one of these kind of vids and now it's all over my recommendation wtf