11 Better Sorting Algorithms in Minecraft

Поділитися
Вставка
  • Опубліковано 14 тра 2024
  • Sorting visualizer in Minecraft.
    GitHub:
    github.com/TheCymaera/minecra...
    Inspired by:
    "15 Sorting Algorithms in 6 Minutes" by Timo Bingmann
    • 15 Sorting Algorithms ...
    GitHub:
    github.com/TheCymaera/minecra...
    Web app:
    heledron.com/misc/sorting-alg...
    All my links:
    heledron.com/links/
    Sources:
    "Quicksort" on Wikipedia.
    en.wikipedia.org/wiki/Quicksort
    "Merge Sort" on Wikipedia. (Bottom Up and Top Down)
    en.wikipedia.org/wiki/Merge_sort
    "Bucket Sort" on Wikipedia.
    en.wikipedia.org/wiki/Bucket_...
    "Selection Sort" on Wikipedia.
    en.wikipedia.org/wiki/Selecti...
    "Heapsort" on Wikipedia.
    en.wikipedia.org/wiki/Heapsort
    "Bubble Sort" on Wikipedia.
    en.wikipedia.org/wiki/Bubble_...
    "Insertion Sort" on Wikipedia.
    en.wikipedia.org/wiki/Inserti...
    "Shellsort” on Wikipedia.
    en.wikipedia.org/wiki/Shellsort
    "Bogosort" on Wikipedia.
    en.wikipedia.org/wiki/Bogosort
    "Fisher-Yates shuffle" on Wikipedia.
    en.wikipedia.org/wiki/Fisher%...
    0:00 - Quick Sort
    0:23 - Bottom Up Merge Sort
    0:51 - Top Down Merge Sort
    1:19 - Bucket Sort (n=3)
    1:43 - Selection Sort
    2:35 - Heap Sort
    3:09 - Bubble Sort
    4:29 - Insertion Sort
    5:25 - Shell Sort
    5:52 - Bogo Sort
    6:29 - Bozo Sort
    6:45 - Quick Sort at 5 ticks per event
  • Наука та технологія

КОМЕНТАРІ • 54

  • @balls4755
    @balls4755 Рік тому +473

    There’s a universe where boho sort is always fastest and no one knows why

    • @heledron
      @heledron  11 місяців тому +299

      There's a universe where they use it in critical infrastructure and everything fails one day.

    • @SpaceNebula69
      @SpaceNebula69 5 місяців тому +49

      @@heledronthere’s a universe where i can understand what the heck a mile is

    • @WoahRoNisCool
      @WoahRoNisCool Місяць тому +20

      @@SpaceNebula69theres a universe where i actually get good grades

    • @SpaceNebula69
      @SpaceNebula69 Місяць тому +10

      @@WoahRoNisCool there’s a universe where i can understand my parents

    • @WoahRoNisCool
      @WoahRoNisCool Місяць тому +8

      @@SpaceNebula69 there a a universe where this chain wont exist

  • @liamfinlay2039
    @liamfinlay2039 Місяць тому +96

    Because my intelligence is average. I don't understand what's going on exactly. But i likes it.

    • @connor7272
      @connor7272 Місяць тому +6

      So if you want to understand, what is basically happening is you have say a line of increasingly higher stacks of blocks, and you scramble them in any particular order. You then write a code that will start at wherever you want the shortest stack and end where you want largest stack. (Let’s just say left is small right is big for simplicity sake)This reader will detect two things. If the stack is higher than the one on the right, and smaller than the one on the left. If the stack is smaller than the one of the left, it will re-write the stacks so the shorter one is now on the left. If the stack is bigger than the one on the right, it will move the stack to the right .
      Now that’s just a regular sorter system but you can make small variations in order to either sort in a different way or sort faster or whatever.
      This is actually very similar to how item sorters work in your regular Minecraft. Blocks have different ids and are sorted by id numbers.
      Long story short it will individually sort each stack one at a time until eventually it’s completely sorted
      It’s not that complicated once you understand it
      Sorry in advance for wasting your time with this drawn out explanation

  • @Damian-cilr1
    @Damian-cilr1 Рік тому +157

    i love how slow quick sort actually kinda sounded like a song

  • @heledron
    @heledron  Рік тому +166

    Hey hey! Here's an improved version of my last sorting algorithms video. By popular demand, I added bucket/radix sort and bogosort. I also fixed the shuffling algorithm and added visualization for read-instructions and auxiliary storage.
    Sorry for the few months of inactivity, I was waiting for bogosort to finish.

  • @watercolours4526
    @watercolours4526 7 місяців тому +54

    quick sort: select the pivot number, move it to the end of the array, then divide the array into two other arrays with one having numbers larger than the pivot and the other one having numbers less than the pivot, repeat until done
    merge sort: divide the array into two arrays, then divide again, and again, and repeat until the smallest array has only one number, then sort numbers in the subarrays, repeat until done
    bucket sort: create multiple subarrays depending on which values are in the original array (e.g. 0-9, 10-19, 20-29), then move the values to its corresponding subarrays, then place back already sorted values into the array
    selection sort: find the smallest number in the array, move it to the start of the array, repeat until done
    heap sort: make a "family tree" of numbers, if a parent is smaller than the child then swap, repeat until done, then swap the first and last values in the array and delete the last one from the tree, repeat until done
    bubble sort: find the largest number in the array, move it to the end of the array, repeat until done
    insertion sort: set a marker for the sorted section after the first value, then insert the next number in the unsorted section to the sorted section where it should be, repeat until done
    shell sort: compare two numbers apart from each other, swap if the first one is larger, repeat until done
    bogo sort: randomise the order, repeat until done
    bozo sort: swap 2 random numbers, repeat until done

  • @frankie11998
    @frankie11998 7 місяців тому +27

    we makin it out of the stronghold with this one 🔥🔥🔥🔥

  • @pallace
    @pallace Рік тому +54

    To think that this game started as a children's voxel game and to think how it evolved, to sorting algorithms , makes you wonder about the future.... lovely video!

    • @TylerTMG
      @TylerTMG 6 місяців тому +1

      why am i thinking about jenny mod....

    • @TylerTMG
      @TylerTMG 6 місяців тому +1

      -does anyone know how to get it-

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

      @@TylerTMGoh please no

    • @TylerTMG
      @TylerTMG 5 місяців тому

      @@xanderplayz3446(:

  • @Ell0_sTadium66
    @Ell0_sTadium66 Рік тому +20

    we need lsd radix.

  • @BlockMasterT
    @BlockMasterT 10 місяців тому +15

    I thought it was taking a break from sorting to make a terrain with clouds during the bucket sort 💀

  • @Doodoofart725
    @Doodoofart725 Місяць тому +1

    The slow quick sort at the end sounds like a chase sequence from a movie.

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

    funny that you added bucket sort considering this was written in bukkit

  • @emanuel_medoo
    @emanuel_medoo Рік тому +16

    Hey man! I have a school project about algorithms and I have to make a video about it, could you maybe explain how you put it all together and make it work in minecraft? Thanks.

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

      You should join the Discord group. It's easier for me to help you if I know more about your assignment and I can share code snippets there. There's also a GitHub repo in the description.
      Here's an overview:
      This is a Bukkit plugin written in Kotlin.
      I create an array list that keeps track of changes that have been made to it.
      I run each algorithm on the array to get a list of changes; these are all well known sorting algorithms.
      I then schedule each change to be displayed by placing blocks at a certain time.

  • @HeroMovies-fl4mm
    @HeroMovies-fl4mm Місяць тому +2

    Could you also add time and space complexity for these?

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

    The bogo sort is so painful

    • @1224chrisng
      @1224chrisng Рік тому +4

      Bogo and Bozo sort were at least on the kid's table, I literally had to skip through Bubble Sort cause it just couldn't play fair

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

      @@1224chrisng I think Selection Sort had it the worst though.

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

    Now we need radix 10 😂

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

    So satisfying keep it up

  • @steve_cat5504
    @steve_cat5504 10 днів тому

    Selection sort sounds like the soundtrack to a horror game. Others too

  • @_neophyte
    @_neophyte 6 місяців тому

    You should add bogosort at the enf to make the video a lot longer

  • @vikram396
    @vikram396 Місяць тому

    1:29 all I’m hearing is flight of the bumble bee 😂

  • @Bard_Gaming
    @Bard_Gaming Місяць тому

    Fire outro song

  • @xkainblackraven2883
    @xkainblackraven2883 Місяць тому

    and stalin sort?

  • @Austin01Powers
    @Austin01Powers Місяць тому

    Very interesting

  • @JC-kk4ph
    @JC-kk4ph Рік тому +7

    Cool! I'll pretend I understand how all of this works!

  • @backstealer9288
    @backstealer9288 Місяць тому +2

    No miracle sort... what a shame

    • @cara-setun
      @cara-setun Місяць тому +2

      It’s there, it just happened to look like quicksort

  • @SealProgrammer
    @SealProgrammer 7 місяців тому +2

    Stalin sort?

  • @shyvv.
    @shyvv. 29 днів тому

    Am I the only one who heard The Perfect Girl by Mareux for a split second at 7:03?

  • @usser-505
    @usser-505 Місяць тому

    Didn't understand a thing even tho programmed these algorithms 😂

  • @kvanzi
    @kvanzi 10 місяців тому +3

    bogo and bozo sort 💀

  • @MrAblenker
    @MrAblenker Місяць тому

    what the hell i did watch here?