8 Sorting Algorithms in Minecraft

Sdílet
Vložit
  • čas přidán 17. 03. 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_...
  • Hry

Komentáře • 624

  • @69k_gold
    @69k_gold Před 2 lety +4920

    In a magical universe where selection sort is the fastest algorithm

    • @average792
      @average792 Před 2 lety +99

      Well i think pigeonhole sort is the fastest

    • @cope9489
      @cope9489 Před 2 lety +404

      Bogosort: hold my beer

    • @MrWite1
      @MrWite1 Před 2 lety +268

      @@cope9489 quantum bogosort: hold my beer

    • @lucasanddre
      @lucasanddre Před 2 lety +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 Před 2 lety +33

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

  • @Audrix98
    @Audrix98 Před 2 lety +2937

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

  • @nw3473
    @nw3473 Před 2 lety +2959

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

    • @julianw1010
      @julianw1010 Před 2 lety +24

      That's.. the point?

    • @manutavano
      @manutavano Před 2 lety +90

      @@julianw1010 not really. not at all actually

    • @Caleb-fv5fp
      @Caleb-fv5fp Před 2 lety +1

      @Liam Tran yes

    • @Caleb-fv5fp
      @Caleb-fv5fp Před 2 lety +1

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

    • @manutavano
      @manutavano Před 2 lety +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)

  • @MA-naconitor
    @MA-naconitor Před 2 lety +868

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

    • @1R4MgMYl7a
      @1R4MgMYl7a Před rokem

      who asked though...

    • @danielyuan9862
      @danielyuan9862 Před rokem

      @@1R4MgMYl7a who asked for your opinion anyway

    • @lightning_11
      @lightning_11 Před rokem +34

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

    • @user-nm8ho8gy7o
      @user-nm8ho8gy7o Před rokem +11

      @@1R4MgMYl7a is asking required?

    • @um_idkw
      @um_idkw Před rokem +3

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

  • @MaxNovOfficial
    @MaxNovOfficial Před 8 měsíci +537

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

  • @heledron
    @heledron  Před 2 lety +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!
    czcams.com/video/Lvd03mSjYZ0/video.html

    • @Manny73211
      @Manny73211 Před 2 lety +4

      the bubble sort was the most interesting.

    • @Manny73211
      @Manny73211 Před 2 lety +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 Před 2 lety

      Ayyyy

    • @king_james_official
      @king_james_official Před 2 lety +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 Před 2 lety +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 Před 2 lety +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._. Před 2 lety +104

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

  • @Alberos
    @Alberos Před 2 lety +90

    Oh no! you forgot the whooooooopp sound lol

  • @ronaldiplodicus
    @ronaldiplodicus Před 2 lety +96

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

  • @shortcutDJ
    @shortcutDJ Před 2 lety +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

  • @ieatnoodls
    @ieatnoodls Před 2 lety +20

    2:28 Sounds like the infinite stairs from Sm64

  • @TheLemon420
    @TheLemon420 Před rokem +10

    1:15 I was not ready

  • @smaybius
    @smaybius Před 2 lety +178

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

  • @Wmann
    @Wmann Před 2 lety +103

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

  • @GGBeyond
    @GGBeyond Před 2 lety +20

    Bubble sort is trying its best.

    • @LeBeaBae
      @LeBeaBae Před 7 měsíci

      sounds Zelda like

  • @alexandrutirtiu8084
    @alexandrutirtiu8084 Před 2 lety +18

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

  • @bazingatheskialuser3519
    @bazingatheskialuser3519 Před 2 lety +82

    i bet bogo sort _could_ do it all instantly
    _could_

  • @3.D.L
    @3.D.L Před 10 měsíci +8

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

  • @CowbellStudioss
    @CowbellStudioss Před 2 lety +27

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

  • @astro_cat030
    @astro_cat030 Před 2 lety +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  Před 2 lety +57

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

    • @astro_cat030
      @astro_cat030 Před 2 lety +2

      @@heledron oh ok understood.

    • @heledron
      @heledron  Před 2 lety +8

      Here’s an updated visualization: czcams.com/video/MvZTflVHiv4/video.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 Před 2 lety +3

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

    • @Gandarf_
      @Gandarf_ Před 2 lety

      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

  • @Intrafacial86
    @Intrafacial86 Před 2 lety +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 Před 2 lety +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 Před 2 lety +4

      Everything is an optimized gnome sort

    • @rubykanima
      @rubykanima Před 2 lety

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

    • @beim8247
      @beim8247 Před 2 lety

      @@rubykanima same lmao

  • @tommasomaruffi1306
    @tommasomaruffi1306 Před 2 lety +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 Před 8 měsíci +12

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

    • @karter_devolidad
      @karter_devolidad Před 4 měsíci

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

  • @motzacarosh8060
    @motzacarosh8060 Před 2 lety +4

    2:50
    chase scene in horror video games

  • @LiamClowMusic
    @LiamClowMusic Před 2 lety +19

    This is an amazing video. Loved it

  • @poiopop
    @poiopop Před 7 měsíci +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

  • @twiddle10000
    @twiddle10000 Před 2 lety +5

    Even Minecraft shows how hilariously inefficient Bubble Sort is.

  • @halfbaked8278
    @halfbaked8278 Před 2 lety

    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

  • @_-_-_-_-_-_-_-_-_-_-_-_-_-_

    Ok now I want to see bogo sort

  • @user-or5jy9hp8x
    @user-or5jy9hp8x Před 4 měsíci +1

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

  • @sonicwaveinfinitymiddwelle8555
    @sonicwaveinfinitymiddwelle8555 Před 8 měsíci +2

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

  • @ModestNeophyte
    @ModestNeophyte Před 4 měsíci +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

  • @SimonsAstronomy
    @SimonsAstronomy Před 8 měsíci +2

    The sound is the best on these things

  • @stacklysm
    @stacklysm Před 2 lety +6

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

    • @Mnnvint
      @Mnnvint Před 2 lety +3

      the object for that would have to be block.hanging_roots

  • @untoldentity
    @untoldentity Před 2 lety +7

    music to my ears

  • @veridan2582
    @veridan2582 Před 2 lety +2

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

  • @draguladriver
    @draguladriver Před 2 lety +6

    i love that you used noteblocks for the sounds!

  • @kellisuzuki8889
    @kellisuzuki8889 Před rokem +1

    merge and quick sort were the most satisfying

  • @hussainabbas1341
    @hussainabbas1341 Před rokem

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

  • @riteshrobotics9713
    @riteshrobotics9713 Před 2 lety +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 Před 2 lety +10

      Bogo sort*

    • @kyrioz2z834
      @kyrioz2z834 Před 2 lety +29

      bogo sort random everything
      while bozo sort swaps random item

    • @hectobreak8097
      @hectobreak8097 Před 2 lety +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 Před 2 lety +1

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

    • @rench2215
      @rench2215 Před 2 lety

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

  • @SURok695
    @SURok695 Před rokem

    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 >_

  • @nicholasmann1832
    @nicholasmann1832 Před 4 měsíci

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

  • @teinaka
    @teinaka Před 8 měsíci

    These sounds are so calming for some reason

  • @Klabbity_Kloots
    @Klabbity_Kloots Před 4 měsíci

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

  • @------------------------..__

    Heap and bubble sort: *horror movie soundtrack*

  • @itscky2007
    @itscky2007 Před 2 lety +2

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

  • @TheCrack_0124
    @TheCrack_0124 Před 2 lety +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.

  • @DurtKokayne
    @DurtKokayne Před 2 lety

    This is so cool! I love it!

  • @Sydneymotor2
    @Sydneymotor2 Před rokem +1

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

  • @benmartinez1267
    @benmartinez1267 Před 2 lety +1

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

  • @nakalimutko
    @nakalimutko Před 5 měsíci +2

    1:20 takes me back to Tom and Jerry

  • @Timoha4684
    @Timoha4684 Před 2 lety

    You did a great job. Really.

  • @saucepart2electricboogaloo461

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

    • @hydrogen-8
      @hydrogen-8 Před 8 měsíci

      might be one a them newfangled data packs

  • @JulianGaming007
    @JulianGaming007 Před 2 lety +7

    This was really satisfying to watch

  • @lehanniehaus9889
    @lehanniehaus9889 Před rokem

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

  • @alfredocandia6178
    @alfredocandia6178 Před 2 lety +10

    Excelente, has juntado mis dos pasiones gracias por compartir😀

    • @deliocache2528
      @deliocache2528 Před rokem

      Your two passions are sorting algorithms and Minecraft???

    • @Xxxx-xm5qu
      @Xxxx-xm5qu Před rokem

      @@deliocache2528 xd

  • @lancestryker
    @lancestryker Před 8 měsíci

    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.

  • @SprinchelArt
    @SprinchelArt Před 2 lety +1

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

  • @GSFigure
    @GSFigure Před 8 měsíci

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

  • @polotypescf4582
    @polotypescf4582 Před 2 lety +5

    keep up your work :D

  • @Senickres
    @Senickres Před 2 lety +5

    This is very cool! Can I download the map?

  • @podlaskian
    @podlaskian Před 2 lety

    funny beeps and lines make human happy

  • @Ramon314
    @Ramon314 Před 2 lety +6

    Is it just me or does the shuffling not seem random?

    • @danielyuan9862
      @danielyuan9862 Před 7 měsíci +1

      It's not. A significant number of items have not moved.

  • @liamdayshaungongob1848
    @liamdayshaungongob1848 Před 11 měsíci

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

  • @siktudy
    @siktudy Před 2 lety

    I love the last part of merge

  • @Frogg_ie
    @Frogg_ie Před 9 měsíci +2

    2:36 sounds like a pikmin dying

  • @weaponizedestrogen
    @weaponizedestrogen Před 8 měsíci

    What are the pitches supposed to represent? The size of the column being moved, the location of where it is, or where the column is moved?

  • @Deathworm-eg5lt
    @Deathworm-eg5lt Před 2 lety

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

  • @helved807
    @helved807 Před 8 měsíci

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

  • @jacksonlaframboise6257

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

    • @jacksonlaframboise6257
      @jacksonlaframboise6257 Před rokem

      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.

  • @NeverackWinteright
    @NeverackWinteright Před 2 lety +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 Před 2 lety +4

      omg the sounds are so funny hahaha

    • @Beatsbasteln
      @Beatsbasteln Před 2 lety +3

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

    • @nw3473
      @nw3473 Před rokem +2

      The funny police

  • @KoviPlaysPC
    @KoviPlaysPC Před 2 lety +1

    Awesome visuals, but the sound tho!

  • @jonnytb212
    @jonnytb212 Před 2 lety

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

  • @Canvas_VI
    @Canvas_VI Před 2 lety +1

    In my opinion, Heap Sort is the coolest

  • @insertnamehere9180
    @insertnamehere9180 Před 2 lety +7

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

  • @specialagentb4977
    @specialagentb4977 Před 2 lety +14

    Does this have any practical applications for actual datapacks or anything?

    • @WilcoVerhoef
      @WilcoVerhoef Před 2 lety +2

      No

    • @templed2021
      @templed2021 Před 2 lety +2

      its just a sorting algorithm to sort numbers, etc this one is from least to greatest

    • @bnzzy_3104
      @bnzzy_3104 Před 2 lety +7

      its literally sorting, it does what it sounds like. if a datapack needed something to be sorted then yes it would be useful.

    • @ieatthighs
      @ieatthighs Před 2 lety

      @beta male are you calling sorting algorithms useless?

    • @ieatthighs
      @ieatthighs Před 2 lety

      @beta male that's a visualisation
      in minecraft
      for FUN. you know what this is?

  • @friedchickenUSA
    @friedchickenUSA Před 2 lety +1

    love it. just wish bogo sort got an appearence.

  • @hollowknightenjoyer
    @hollowknightenjoyer Před 2 lety +2

    The shuffle sort

  • @fierylightning3422
    @fierylightning3422 Před 2 lety +1

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

  • @erionncs
    @erionncs Před rokem

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

  • @RogersGaming07
    @RogersGaming07 Před 2 lety +3

    0:25
    🎇🎆🎇🎆🎇🎆

  • @powerxcode5333
    @powerxcode5333 Před 5 dny

    Never knew that the first algorithm they teach you in school is the slowest. Also please do count sort.

  • @sc6the
    @sc6the Před 7 měsíci

    man i love the shuffle sorting algorithm

  • @fatpancake52
    @fatpancake52 Před 8 měsíci

    this will be the new "can it run doom"

  • @puzzlepuddles6712
    @puzzlepuddles6712 Před 2 lety +2

    oh god you made this in minecraft

  • @LuisFelipe-pq9lr
    @LuisFelipe-pq9lr Před 6 měsíci

    I whished my teacher had used this video to teach us, just finished this class and I really like it

  • @prashidash
    @prashidash Před 2 lety

    It never got fully shuffled

  • @exlpt2234
    @exlpt2234 Před rokem

    Very impressive, but I think in-place base 10 radix sort is needed

  • @Nicofisi
    @Nicofisi Před 2 lety +1

    Love the idea but I was very dissatisfied every time by how little time you gave it to shuffle the columns, many of them didn't even get moved once :(

  • @themovercell2318
    @themovercell2318 Před rokem

    Bogo sort: Keep shuffling until it is sorted

  • @blacklight683
    @blacklight683 Před 2 lety +1

    2:30power is going down!

  • @WTPawel
    @WTPawel Před 2 lety +3

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

  • @thermitty_qxr5276
    @thermitty_qxr5276 Před rokem

    Hey in the shell sort part actually thats comb sort. Because shell sort use more lines to do that.

  • @arthurrochamattathecreator3070

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

  • @KainAndTheWildlandsOfficial

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

  • @simplecoder8459
    @simplecoder8459 Před rokem

    Thanks, I have interview next week. It helps

  • @riyamu7740
    @riyamu7740 Před 8 měsíci

    Now sorting systems with pistons and actual noteblocks playing the sounds

  • @Maasonn
    @Maasonn Před 8 měsíci +1

    Imagine showing this video to someone from the 1800s

  • @NolyJ
    @NolyJ Před rokem +1

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