8 Sorting Algorithms in Minecraft

Поділитися
Вставка
  • Опубліковано 17 бер 2022
  • Sorting visualizer in Minecraft.
    Inspired by:
    "15 Sorting Algorithms in 6 Minutes" by Timo Bingmann
    • 15 Sorting Algorithms ...
    GitHub:
    github.com/TheCymaera/minecra...
    A web-based sorting algorithm visualizer I made:
    heledron.com/misc/sorting-alg...
    All my links:
    heledron.com/links/
    Sources:
    "Insertion Sort" on Wikipedia.
    en.wikipedia.org/wiki/Inserti...
    "Selection Sort" on Wikipedia.
    en.wikipedia.org/wiki/Selecti...
    "Merge Sort" on Wikipedia. (Bottom Up and Top Down)
    en.wikipedia.org/wiki/Merge_sort
    "Heapsort" on Wikipedia.
    en.wikipedia.org/wiki/Heapsort
    "Quicksort" on Wikipedia.
    en.wikipedia.org/wiki/Quicksort
    "Shellsort” on Wikipedia.
    en.wikipedia.org/wiki/Shellsort
    "Bubble Sort" on Wikipedia.
    en.wikipedia.org/wiki/Bubble_...
  • Ігри

КОМЕНТАРІ • 619

  • @69k_gold
    @69k_gold 2 роки тому +4910

    In a magical universe where selection sort is the fastest algorithm

    • @average792
      @average792 Рік тому +99

      Well i think pigeonhole sort is the fastest

    • @cope9489
      @cope9489 Рік тому +404

      Bogosort: hold my beer

    • @MrWite1
      @MrWite1 Рік тому +267

      @@cope9489 quantum bogosort: hold my beer

    • @lucasanddre
      @lucasanddre Рік тому +80

      If you have information about your input that it is almost ordered, selection sort can be faster than quicksort for example.

    • @69k_gold
      @69k_gold Рік тому +33

      @@lucasanddre Yeah I've actually read about this method used in scoreboard calculations. Although it's a very specific scenario

  • @MA-naconitor
    @MA-naconitor Рік тому +863

    Notch: I’m gonna make a block-based environmental survival game
    Sorting algorithm: PEW PEW PEW PEW

    • @1R4MgMYl7a
      @1R4MgMYl7a Рік тому

      who asked though...

    • @danielyuan9862
      @danielyuan9862 Рік тому

      @@1R4MgMYl7a who asked for your opinion anyway

    • @lightning_11
      @lightning_11 Рік тому +34

      @@1R4MgMYl7a Life is about being glad they answered without you having to ask...

    • @user-nm8ho8gy7o
      @user-nm8ho8gy7o Рік тому +11

      @@1R4MgMYl7a is asking required?

    • @um_idkw
      @um_idkw Рік тому +3

      ​@Impunity i don't like people who are in 4th grade. They are very not nice.

  • @Audrix98
    @Audrix98 Рік тому +2922

    Was hoping it would be colored green after it finished sorting.

  • @MaxNovOfficial
    @MaxNovOfficial 8 місяців тому +532

    This is something that could be released in 2012 and gotten like 10 million views for how iconic/memorable it would've been

  • @nw3473
    @nw3473 2 роки тому +2957

    I love how it has the beeping to go along with it

    • @julianw1010
      @julianw1010 2 роки тому +24

      That's.. the point?

    • @manutavano
      @manutavano 2 роки тому +90

      @@julianw1010 not really. not at all actually

    • @Caleb-fv5fp
      @Caleb-fv5fp Рік тому +1

      @Liam Tran yes

    • @Caleb-fv5fp
      @Caleb-fv5fp Рік тому +1

      @@manutavano what are you talking about? What is the beeping then?

    • @manutavano
      @manutavano Рік тому +37

      @@Caleb-fv5fp the beeping is just an extra effect to make the video cooler. This is showcasing different sorting algorithms (different ways to sort a set of numbers) implemented in Minecraft. Basically the beep goes off whenever you're making comparisons, but the point of the video really are the little vertical bars getting switched around until they form a steady slope (each bar represents a number, the smaller ones are smaller numbers and the bigger ones are bigger)

  • @heledron
    @heledron  2 роки тому +1488

    Few notes:
    1. Some algorithms use auxiliary storage, which is not rendered. (Yellow animation)
    2. I didn't animate read instructions, so this isn't a good visualization of efficiency.
    3. There are much better algorithms for shuffling arrays. (Fisher-Yates shuffle)
    I fixed all these issues in the web app. I’ll probably redo this video in the future.
    Edit: Here's a revised video!
    ua-cam.com/video/Lvd03mSjYZ0/v-deo.html

    • @Manny_OG
      @Manny_OG Рік тому +4

      the bubble sort was the most interesting.

    • @Manny_OG
      @Manny_OG Рік тому +7

      ✂️ selection sort - the usual one you see with those algorithms with the little beeps that non programmers think are cool
      ↔️insertion sort - seems a bit unusual, and I didn't really look back at it for too long. I wasn't paying much attention, but I've noticed that it wasn't very quick, and I wonder why.
      👞 quick sort - not much to say, it's very quick
      🐚 shell sort - I don't really get what's going on here, but I think it might be taking a random unfinished part and degrading it by a bit to what it's supposed to be. if this is correct, I could see this being used on systems with low memory
      ⬇️ TD merge sort - again not much to say, I find it an interesting approach.
      ⬆️ BU merge sort - it's probably my second favorite (bubble first of course) and I find it to be an amazing (visually, not practically) subset of the merge sort
      ◼️ heap sort - now why are you trying to look cool like merge sort?
      💧bubble sort - an interesting, yet slow algorithm to show to your friends, I wouldn't recommend using this in a program for any reason other than to look cool

    • @isaacstetson5720
      @isaacstetson5720 Рік тому

      Ayyyy

    • @king_james_official
      @king_james_official Рік тому +6

      honestly as a programmer i like quick sort the most. i feel like anyone from my field will understand haha

    • @king_james_official
      @king_james_official Рік тому +1

      also, the fisher-yates shuffle is literally like 5 lines of code (i used javascript and i'm not willing to touch javat so i donmt know how would it look in your situation)

  • @Mnnvint
    @Mnnvint Рік тому +871

    Very cute that you used a shell for shell sort, but that made me expect bucket sort for the bucket! Bubble sort is more of a magma block thing ;)

  • @Sush._.
    @Sush._. 2 роки тому +104

    "What kind of music do you like?"
    Me: "It's complicated"

  • @Alberos
    @Alberos 2 роки тому +89

    Oh no! you forgot the whooooooopp sound lol

  • @ronaldiplodicus
    @ronaldiplodicus Рік тому +96

    The shuffle feature leaves a significant portion of the things unsorted. Still really fun to watch though I like it.

  • @GGBeyond
    @GGBeyond Рік тому +19

    Bubble sort is trying its best.

    • @LeBeaBae
      @LeBeaBae 7 місяців тому

      sounds Zelda like

  • @shortcutDJ
    @shortcutDJ Рік тому +122

    Some of them are very musical, they have almost an arpeggio sound to them, the last one is more like a chord. i also learned about shell sort which is pretty nifty

  • @3.D.L
    @3.D.L 10 місяців тому +8

    2:08 WE MAKIN IT OUTTA THE MATHS CLASS WITH THIS ONE 🔥🔥🔥🔥🗣🗣🗣🗣🔊🔊

  • @Wmann
    @Wmann 2 роки тому +103

    Would love the last bottom to top swipe with that swoosh sound to signify that it’s finished, but this is still amazing.

  • @smaybius
    @smaybius 2 роки тому +178

    I wonder why quicksort on most visualizers I see uses only specifically the Lomuto partition. Geeks4Geeks probably also only uses Lomuto partitions.

  • @ieatnoodls
    @ieatnoodls 2 роки тому +20

    2:28 Sounds like the infinite stairs from Sm64

  • @CowbellStudioss
    @CowbellStudioss 2 роки тому +27

    anyone else have absolutely no idea what is happening, yet still find it cool?

  • @TheLemon420
    @TheLemon420 Рік тому +8

    1:15 I was not ready

  • @bazingatheskialuser3519
    @bazingatheskialuser3519 2 роки тому +82

    i bet bogo sort _could_ do it all instantly
    _could_

  • @alexandrutirtiu8084
    @alexandrutirtiu8084 2 роки тому +17

    The last one sounds like it is saying "Move it" - 3:23

  • @twiddle10000
    @twiddle10000 Рік тому +5

    Even Minecraft shows how hilariously inefficient Bubble Sort is.

  • @tommasomaruffi1306
    @tommasomaruffi1306 Рік тому +82

    I don't know you, but this video is very useful to easily understand how these algorithms work compared to the other ones I've seen

    • @paper177
      @paper177 8 місяців тому +11

      othr = hadr‼️‼️😡😡
      micraf = esy 😃😃😎😎😱😱🤯🤯

    • @karter_devolidad
      @karter_devolidad 4 місяці тому

      It's literally the exact same as any other sorting algorithm video 😂

  • @Intrafacial86
    @Intrafacial86 Рік тому +8

    I bet Radix LSD In-Place Base-10 sort starts sounding like 9001 suffocating Ghasts before ending with 9001 villagers hrrmming all at once.

  • @beim8247
    @beim8247 2 роки тому +23

    insertion sort looks like optimized gnome sort
    gnome sort swaps a select element backward until it finds the right spot
    insertion sort checks each element backwards from a select element until it finds the right spot

    • @SwiftDustStorm
      @SwiftDustStorm 2 роки тому +4

      Everything is an optimized gnome sort

    • @rubykanima
      @rubykanima 2 роки тому

      it IS the optimised gnome sort. Coded a gnome sort accidentaly while programming ;D

    • @beim8247
      @beim8247 2 роки тому

      @@rubykanima same lmao

  • @astro_cat030
    @astro_cat030 2 роки тому +195

    I think Merge sort (bottom up) is supposed to be called "Wiki sort". I think the both merge sort isnt done right since you need 2 pieces to merge them and not four of them once but its still fast.

    • @heledron
      @heledron  2 роки тому +57

      Some of the algorithms look weird because they’re writing to an auxiliary array.

    • @astro_cat030
      @astro_cat030 2 роки тому +2

      @@heledron oh ok understood.

    • @heledron
      @heledron  2 роки тому +8

      Here’s an updated visualization: ua-cam.com/video/MvZTflVHiv4/v-deo.html
      You can see the arrays swapping roles. At first the primary array has 4 partitions, then merges into the auxiliary array with 2 partitions, then merges back into the primary array with 1 partition. So the sequence appears as 4, 1.

    • @smaybius
      @smaybius 2 роки тому +3

      Wiki sort is an in place block merge sort, completely different from the regular out of place bottom up merge

    • @Gandarf_
      @Gandarf_ Рік тому

      Merge sort does not require to be 2 parts merged, it can be k parts merged. For example, in external memory merge sort always use k-partition for some k

  • @poiopop
    @poiopop 6 місяців тому +8

    Amazingly satisfying sorting but it’s missing that one final BWOOOOOP at the end of each sorting to check they’re all in order

  • @motzacarosh8060
    @motzacarosh8060 Рік тому +4

    2:50
    chase scene in horror video games

  • @LiamClowMusic
    @LiamClowMusic 2 роки тому +19

    This is an amazing video. Loved it

  • @halfbaked8278
    @halfbaked8278 Рік тому

    I actually learned about sorting algorithms in school a week ago, well only bucket sort and bubble sort but it's still great to learn a little bit

  • @_-_-_-_-_-_-_-_-_-_-_-_-_-_
    @_-_-_-_-_-_-_-_-_-_-_-_-_-_ 2 роки тому +5

    Ok now I want to see bogo sort

  • @veridan2582
    @veridan2582 Рік тому +2

    Heap sort sounding like my motivation over the course of a day...

  • @TheCrack_0124
    @TheCrack_0124 Рік тому +2

    me see other sorting algorithms: it is so slow, must be bubble sort.
    me realize that I am wrong all the time and see the last item is water bucket: it must be the famous bucket sort.
    The water bucket: sike.

  • @itscky2007
    @itscky2007 Рік тому +2

    this wont do without the green "woooooooop"
    still funny tho

  • @untoldentity
    @untoldentity 2 роки тому +7

    music to my ears

  • @nakalimutko
    @nakalimutko 5 місяців тому +2

    1:20 takes me back to Tom and Jerry

  • @user-or5jy9hp8x
    @user-or5jy9hp8x 4 місяці тому +1

    真的厲害!還是第一次看到在Minecraft裡面用排序的

  • @SimonsAstronomy
    @SimonsAstronomy 8 місяців тому +2

    The sound is the best on these things

  • @Sydneymotor2
    @Sydneymotor2 Рік тому +1

    Bubble sort sounds like there is something chasing you in a horror game.

  • @riteshrobotics9713
    @riteshrobotics9713 2 роки тому +107

    You should also implemented bozo sort (a sorting algorithm that randomly swaps items until they are sorted)
    Edit : its bogo sort sorry

    • @lmao1660
      @lmao1660 2 роки тому +10

      Bogo sort*

    • @kyrioz2z834
      @kyrioz2z834 2 роки тому +29

      bogo sort random everything
      while bozo sort swaps random item

    • @hectobreak8097
      @hectobreak8097 2 роки тому +23

      Both bogosort and bozosort exist, and are both awful ineficient algorithms.
      def bogosort(list):
      while True:
      shuffle(list)
      if isSorted(list):
      return list
      def bozosort(list):
      while True:
      swapRandomPair(list)
      if isSorted(list):
      return list
      There are even worse algorithms, like Worstsort, that recursively sorts the space of permutations to find the sorted one. I don't think you can visualize an algorithm like that using this sort of visualization.

    • @sebassanchez2848
      @sebassanchez2848 2 роки тому +1

      hmmm i do like the sound of this bozo swap though, maybe i should implement it

    • @rench2215
      @rench2215 2 роки тому

      @@hectobreak8097 bogo sort has one of the best best case time complexities though!!!

  • @ModestNeophyte
    @ModestNeophyte 4 місяці тому +1

    i don't know why this is so audibly satisfying.. I would not say it sounds "good" but.. i get this odd nice feeling from hearing it even though i hate dissonance. maybe its the ascension on the final check on each round? idk

  • @stacklysm
    @stacklysm 2 роки тому +6

    Nice video! Would also have been interesting to see Radix Sort

    • @Mnnvint
      @Mnnvint Рік тому +3

      the object for that would have to be block.hanging_roots

  • @sonicwaveinfinitymiddwelle8555
    @sonicwaveinfinitymiddwelle8555 8 місяців тому +2

    Kracc Bacc's let's play is going to have this banger 🗣🗣🔥🔥🔥

  • @draguladriver
    @draguladriver Рік тому +6

    i love that you used noteblocks for the sounds!

  • @nicholasmann1832
    @nicholasmann1832 4 місяці тому

    i haven't the remotest idea what just happened but every literal second of that tickled my brain, sincere thanks.

  • @SURok695
    @SURok695 Рік тому

    This video made me cry.
    I've never used bubble sorting since college but it's the only algorithm I don't forget and don't need to google it every time I need it >_

  • @kellisuzuki8889
    @kellisuzuki8889 Рік тому +1

    merge and quick sort were the most satisfying

  • @------------------------..__
    @------------------------..__ Рік тому +1

    Heap and bubble sort: *horror movie soundtrack*

  • @teinaka
    @teinaka 8 місяців тому

    These sounds are so calming for some reason

  • @hussainabbas1341
    @hussainabbas1341 Рік тому

    Thank you, I love the idea of implement it in Minecraft ❤️

  • @saucepart2electricboogaloo461
    @saucepart2electricboogaloo461 Рік тому +18

    wow, this is really impressive! it must have taken a ton of command blocks

    • @hydrogen-8
      @hydrogen-8 8 місяців тому

      might be one a them newfangled data packs

  • @Maasonn
    @Maasonn 8 місяців тому +1

    Imagine showing this video to someone from the 1800s

  • @GSFigure
    @GSFigure 7 місяців тому

    Merge Sort gives me insane amounts of dopamine because of how consistent and clean it is.

  • @Timoha4684
    @Timoha4684 2 роки тому

    You did a great job. Really.

  • @Klabbity_Kloots
    @Klabbity_Kloots 3 місяці тому

    For some odd reason, the sound of the insertion sort (0:14) reminds me of that one _Pokémon_ scene where a quagsire reunites with the rest of his kind and they all go "Quaaaaaaag!" "Quaaaaaaag!" "Quaaaaaaag!".

  • @benmartinez1267
    @benmartinez1267 Рік тому +1

    Love the video. I think for watching (at least on a phone) the sort names should be in a higher contrast font color

  • @lehanniehaus9889
    @lehanniehaus9889 Рік тому

    the sounds were hilarious, can't believe that I listened to that for 3.5 minutes.

  • @SprinchelArt
    @SprinchelArt Рік тому +1

    The heap sort sounds like something you'd hear in the back rooms

  • @lancestryker
    @lancestryker 7 місяців тому

    2:27 Heap sorting sounds like you're giving a Kubrick Stare as you realize that your life is going downhill past the point of no return.

  • @DurtKokayne
    @DurtKokayne 2 роки тому

    This is so cool! I love it!

  • @richmanarg
    @richmanarg Рік тому +1

    Welcome back to another episode of my youtube recommendation section.

  • @JulianGaming007
    @JulianGaming007 2 роки тому +7

    This was really satisfying to watch

  • @jonnytb212
    @jonnytb212 Рік тому

    Closed captions: hmm do [Music] [applause] [Music] [applause] [Music]

  • @egnogg07
    @egnogg07 8 місяців тому +1

    POV: Everywhere at the end of time after the 3rd album

  • @WTPawel
    @WTPawel Рік тому +3

    Ah, unfortunately no bogo....
    But this video is still awesome!

  • @NeverackWinteright
    @NeverackWinteright Рік тому +13

    Great video! I appreciate how the comments are people actually talking about the sorting algorithms.
    Unfortunately children have recently found the sounds that a sorting algorithm makes to be "funny" so they're going to eventually take over the comments section.
    I'd love to see a tree sort in Minecraft next!

    • @benena9545
      @benena9545 Рік тому +4

      omg the sounds are so funny hahaha

    • @Beatsbasteln
      @Beatsbasteln Рік тому +3

      if you don't find them funny you have no soul :o

    • @nw3473
      @nw3473 Рік тому +2

      The funny police

  • @Canvas_VI
    @Canvas_VI Рік тому +1

    In my opinion, Heap Sort is the coolest

  • @puzzlepuddles6712
    @puzzlepuddles6712 2 роки тому +2

    oh god you made this in minecraft

  • @hollowknightenjoyer
    @hollowknightenjoyer 2 роки тому +2

    The shuffle sort

  • @podlaskian
    @podlaskian Рік тому

    funny beeps and lines make human happy

  • @helved807
    @helved807 7 місяців тому

    I seem to realise the lack of bogo sort, the best and fastest sorting algorithm

  • @erionncs
    @erionncs Рік тому

    Its 3 AM and I'm sitting here watching Minecraft sorting algorithms...

  • @wrevelmusic
    @wrevelmusic 2 роки тому +3

    2:00 i went 💃🕺

  • @KainAndTheWildlandsOfficial
    @KainAndTheWildlandsOfficial 11 місяців тому

    Quicksort: I'm the fastest sort.
    Mergesort: hold my beer.

  • @siktudy
    @siktudy 2 роки тому

    I love the last part of merge

  • @insertnamehere9180
    @insertnamehere9180 2 роки тому +7

    Idk whats more suprising, that this was made or that i know all the sorts and more...

  • @eliteeinheit0530
    @eliteeinheit0530 4 місяці тому +2

    Only real ones know that bogo sort is the fastest

  • @Deathworm-eg5lt
    @Deathworm-eg5lt Рік тому

    I have no idea wtf is going on this video, but it’s fun to watch

  • @ManifestedMadness
    @ManifestedMadness 2 роки тому +4

    You left out the best algorithm, BOGO sort :(

    • @NestAdmiral
      @NestAdmiral 2 роки тому +1

      Shuffle button is bogo sort

    • @ManifestedMadness
      @ManifestedMadness 2 роки тому

      @@NestAdmiral bogo should automatically loop until it is correct though

    • @NestAdmiral
      @NestAdmiral 2 роки тому

      @@ManifestedMadness thing which it never does

  • @tobiaskoran6787
    @tobiaskoran6787 Рік тому

    Admit it, you just like flashy images, quirky sounds and the oddly satisfying feeling when it finishes

  • @themovercell2318
    @themovercell2318 Рік тому

    Bogo sort: Keep shuffling until it is sorted

  • @KoviPlaysPC
    @KoviPlaysPC 2 роки тому +1

    Awesome visuals, but the sound tho!

  • @alfredocandia6178
    @alfredocandia6178 Рік тому +10

    Excelente, has juntado mis dos pasiones gracias por compartir😀

    • @deliocache2528
      @deliocache2528 Рік тому

      Your two passions are sorting algorithms and Minecraft???

    • @Xxxx-xm5qu
      @Xxxx-xm5qu Рік тому

      @@deliocache2528 xd

  • @nitroninja1227
    @nitroninja1227 Рік тому

    The lack of bogosort is a crime.

  • @liamdayshaungongob1848
    @liamdayshaungongob1848 10 місяців тому

    The shell sort sounds like metal like this: ↗️↘️↗️↘️↗️↘️↗️↘️↗️↘️↗️↘️↗️↘️↗️↘️↗️↘️↗️↘️↗️↘️↗️↘️↗️↘️↗️↘️↗️ ...and repeating.

  • @friedchickenUSA
    @friedchickenUSA 2 роки тому +1

    love it. just wish bogo sort got an appearence.

  • @fatpancake52
    @fatpancake52 8 місяців тому

    this will be the new "can it run doom"

  • @angeepukhrambam
    @angeepukhrambam 2 роки тому +1

    When a gamer is a software engineer

  • @nathanbrisson4905
    @nathanbrisson4905 Рік тому +1

    number of block commands behind: infinity

  • @Senickres
    @Senickres 2 роки тому +5

    This is very cool! Can I download the map?

  • @jacksonlaframboise6257
    @jacksonlaframboise6257 Рік тому

    Why did I start giggling at the shuffle sound, more and more as the video progressed.

    • @jacksonlaframboise6257
      @jacksonlaframboise6257 Рік тому

      Ah. I know. The contrast with the marimba….which still makes no sense. But, at least the “halfway through” part was solved. Now I just gotta figure out why it’s hilarious to me.

  • @fierylightning3422
    @fierylightning3422 Рік тому +1

    Sad to see no bogo sort, but I think that would be pain

  • @NolyJ
    @NolyJ Рік тому +1

    i don’t know what a sorting algorithm is but this is cool

  • @nononame26
    @nononame26 Рік тому

    This sounds like my brain when I'm trying to sleep.

  • @samcole5210
    @samcole5210 Рік тому

    this is peak of computer redstone science phd

  • @sc6the
    @sc6the 7 місяців тому

    man i love the shuffle sorting algorithm

  • @prashidash
    @prashidash Рік тому

    It never got fully shuffled

  • @Frogg_ie
    @Frogg_ie 8 місяців тому +2

    2:36 sounds like a pikmin dying

  • @arthurrochamattathecreator3070

    Everyone wished that there was radix lsd in-place sort (base 10) in this video

  • @StuntGota
    @StuntGota 7 місяців тому +1

    algorithms with the name short are the slowest ones

  • @polotypescf4582
    @polotypescf4582 2 роки тому +5

    keep up your work :D