20 Sorting Algorithms Visualized

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 มี.ค. 2020
  • Visualization of 20 different Sorting Algorithms as a disparity loop with sound.
    Sorting Visualizer: github.com/CompilerStuck/sort...
    ✅ Subscribe: / @compilerstuck
    The disparity Loop visualizes disparity of the Elements. If an element is at its original position, the distance from the center is max. if it is far away from its original index the distance from the center is 0.
    Keep in mind that in this example we look at the array as if the beginning and the end is connected. So the distance between the 2nd element and the last is not n-2, but 2. The array is beeing shuffled in reverse.
    ▬▬ My Equipment ▬▬▬▬▬▬▬▬▬▬▬▬▬
    * Microphone: amzn.to/3IFxjnc
    * Monitor: amzn.to/3y3Niqg
    * Keyboard: amzn.to/3Yg9b0A
    * Mouse: amzn.to/3ZdslVZ
    Algorithm Timecodes:
    00:02 Radix Sort (Base 10)
    00:19 Gravity Sort (Bead)
    00:33 Shell Sort
    00:58 Merge Sort
    01:27 Heap Sort
    01:25 Odd Even Sort
    02:40 Comb Sort
    03:07 Double Selection Sort
    03:20 Pigeonhole Sort
    04:06 Selection Sort
    04:26 Quick Sort (Pivot Middle)
    04:34 Quick Sort (Double Pivot)
    04:44 Cycle Sort
    05:01 American Flag Sort
    05:20 Counting Sort
    05:35 Bucket Sort
    05:46 Cocktail Shaker Sort
    06:30 Bubble Sort
    07:16 Insertion Sort
    08:00 Gnome Sort
    09:00 COMPARISON TABLE
    Measurements explained:
    As "Comparison" counts the comparison of a value from the Array with any other value.
    As "Segment" counts every sorted part of the array.
    "Real Time" corresponds to the measured time only used for the algorithm.
    As "Swap" counts the exchange between the indexes of two elements of the array.
    As "Write to the Main Array" counts the change of a value in the Array.
    * The links marked with an asterisk (*) are affiliate links. If you click on such a link and make a purchase, I receive a commission from the respective online shop or provider. The price for you does not change.

ความคิดเห็น • 235

  • @glenndelacruz8157
    @glenndelacruz8157 ปีที่แล้ว +47

    0:35 + 2x speed = sick beat

    • @Dashcave17250
      @Dashcave17250 11 หลายเดือนก่อน +1

      6:34 attraction rotate 45°
      7:22 it pokes your 1/15 harmonics

    • @user-Bharatcomputers
      @user-Bharatcomputers 4 หลายเดือนก่อน

      SORT DOESN'T NEED AUTOTUNE
      0:35

    • @TaiNguyen-oj7tm
      @TaiNguyen-oj7tm 6 วันที่ผ่านมา

  • @TheTvIsBroken_FD
    @TheTvIsBroken_FD 2 ปีที่แล้ว +30

    0:41 Wow the music is so cool

  • @ashermain_2000
    @ashermain_2000 8 หลายเดือนก่อน +24

    Radix Base 10 not being absolutely bass boosted is a blessing.

  • @Holac0moestan132
    @Holac0moestan132 10 หลายเดือนก่อน +5

    2:26 it looks like a cat

  • @FBI_agent_24
    @FBI_agent_24 ปีที่แล้ว +16

    0:23 Motorcycle sound be like:

  • @aster_the_lil_guy
    @aster_the_lil_guy ปีที่แล้ว +7

    3:10 sounds sick

  • @glitchersnadin305
    @glitchersnadin305 ปีที่แล้ว +9

    Shell sort somehow makes a sick beat.

  • @mhyragaddi1866
    @mhyragaddi1866 ปีที่แล้ว +41

    4:08 Selection Sort
    6:31 Bubble Sort
    7:16 Insertion Sort
    3:08 Double Selection Sort

  • @gtdmg489
    @gtdmg489 3 ปีที่แล้ว +67

    The visual and sound reminds me of worthy.

    • @sf803
      @sf803 2 ปีที่แล้ว +1

      w0rthy you mean?

    • @YourLocalBaconRblx
      @YourLocalBaconRblx 2 ปีที่แล้ว

      @@sf803 it’s ok if he doesn’t know how to spell.

    • @pearlopticslahore2881
      @pearlopticslahore2881 ปีที่แล้ว

      Qqqqqg

    • @CompilerStuck
      @CompilerStuck  ปีที่แล้ว +1

      It is actually my own project: github.com/CompilerStuck/sorting-visualizer

    • @galaxygamer2782
      @galaxygamer2782 ปีที่แล้ว

      w0rthy

  • @Obstagoon862
    @Obstagoon862 2 ปีที่แล้ว +26

    Gravity sort was so satisfying!

  • @raffeld.afrinaldi8911
    @raffeld.afrinaldi8911 2 ปีที่แล้ว +18

    1:53 normal turns circle point

  • @Handles_Are_Bad_Lol
    @Handles_Are_Bad_Lol ปีที่แล้ว +5

    Why does shuffling take so long when bogosort exists?

  • @MainChannelTheme
    @MainChannelTheme 2 ปีที่แล้ว +6

    Shell sort is a banger.

  • @abysspegasusgaming
    @abysspegasusgaming 6 หลายเดือนก่อน +1

    0:35 I was feeling a bit froggy that Sunday... Must've been a witch that turned me into a newt. I'm all better now though.

  • @wrigglel
    @wrigglel ปีที่แล้ว +4

    0:03 rainbow sign (rainbow spread)

  • @eyeman2534
    @eyeman2534 ปีที่แล้ว +5

    0:46 looks like a Ruffles

  • @MoosesValley
    @MoosesValley 3 ปีที่แล้ว +36

    Awesome work. These visualisations may not help a beginner understand / differentiate the various sorting algorithms, but they sure are interesting and make a lot of sense when you understand the algorithms, have written the code to implement them, etc. eg. The merge sort splitting the array in half over and over and then recombining the chunks recursively. You are proving that even after 70+ years of digital programmable computers, we can still find new and interesting and sometimes better ways to visualise processes and data. Keep up the great work !! +1 LIKE. +1 SUBSCRIBE.

    • @CompilerStuck
      @CompilerStuck  3 ปีที่แล้ว

      Thank you very much!

    • @rcb3921
      @rcb3921 2 ปีที่แล้ว +2

      "These visualisations may not help a beginner understand / differentiate the various sorting algorithms."
      There is no need to soften or qualify your criticism, it is spot on. This work does not help one to understand sorting algorithms.

    • @AleksSPace
      @AleksSPace 2 ปีที่แล้ว +1

      @@rcb3921 Too much "art", too little "sense". Starting with shuffle.

    • @maurolionelmipianoyyo11
      @maurolionelmipianoyyo11 2 ปีที่แล้ว

      I know how to insertion sort

    • @CompilerStuck
      @CompilerStuck  ปีที่แล้ว +1

      If you wanna play around with it yourself: github.com/CompilerStuck/sorting-visualizer

  • @Normal762
    @Normal762 ปีที่แล้ว +5

    2:26 wow

  • @Potato35634
    @Potato35634 ปีที่แล้ว +3

    0:37 is a banger

  • @Kyle_the_duck
    @Kyle_the_duck 11 หลายเดือนก่อน +4

    0:00 me dancing:

  • @MoonGold42
    @MoonGold42 2 ปีที่แล้ว +9

    5:48this is making me dance

  • @apportensmortis
    @apportensmortis 8 หลายเดือนก่อน +1

    THE ONE AT 0:35 GOES FUCKING HARD

  • @matthiashenke5306
    @matthiashenke5306 7 หลายเดือนก่อน +2

    This is the Best Sound Ever

  • @PhilippinesTheAmazingCountry
    @PhilippinesTheAmazingCountry 3 หลายเดือนก่อน +1

    7:19 me laughing atva cave and realises there is no caves

  • @ProTheRobloxer
    @ProTheRobloxer 11 หลายเดือนก่อน +1

    Cycle Sort: Who are you?
    Double Selection Sort: I’m you, but faster

  • @XD-vd2xw
    @XD-vd2xw ปีที่แล้ว +3

    X: whats 6 + 4?
    My brain: 1:31
    Me: 47

  • @BulGoogol
    @BulGoogol 4 หลายเดือนก่อน +1

    0:35 fire

  • @arcrius4
    @arcrius4 ปีที่แล้ว +6

    It seems like Bucket sort at 5:38 was doing what I normally see Pigeonhole sort do in other videos. (Elements equals writes to main array, writes to aux array is 2x elements, and no swaps).
    I had no clue what the Pigeonhole sort in this video was doing at 3:22.

    • @FP0S_1
      @FP0S_1 ปีที่แล้ว +3

      3:22 - Pigeonhole Sort
      8/10
      It's so good! I like the sound.

    • @Normal762
      @Normal762 ปีที่แล้ว

      ​@@FP0S_1 me too

    • @chrisrodriguezm13
      @chrisrodriguezm13 6 หลายเดือนก่อน +1

      The pigeonhole sort was pretending itself to be the insertion sort

    • @kawkanat1616
      @kawkanat1616 4 หลายเดือนก่อน

      @@FP0S_1 really cool

  • @Tubedroid2024
    @Tubedroid2024 ปีที่แล้ว +2

    2:24 your business has a emoji cat

  • @user-pn7ty2he6m
    @user-pn7ty2he6m 4 ปีที่แล้ว +39

    Very interesting, thank you. Any chance I could get a copy of your spreadsheet? You gathered some wonderful data but I couldn't play with it!

    • @CompilerStuck
      @CompilerStuck  4 ปีที่แล้ว +2

      Hey, thanks for your feedback.
      I am currently setting up a GitHub-Repo with my stuff, but it's private yet.
      I could contact you when i publish it.

    • @user-pn7ty2he6m
      @user-pn7ty2he6m 4 ปีที่แล้ว +2

      @@CompilerStuck Cool! You can reach me at y4zxx1ypp9sb@opayq.com or just post here.

    • @CompilerStuck
      @CompilerStuck  4 ปีที่แล้ว +1

      @@user-pn7ty2he6m kk

    • @CompilerStuck
      @CompilerStuck  ปีที่แล้ว +2

      It has been long, but here it is: github.com/CompilerStuck/sorting-visualizer

    • @marble5515
      @marble5515 ปีที่แล้ว

      LoL .. 2 years

  • @LVETOT
    @LVETOT 3 ปีที่แล้ว +2

    Subscribed! :D

  • @nunthenihtara608
    @nunthenihtara608 2 ปีที่แล้ว +23

    Medal for Shell sort: 🥇

  • @Musicombo
    @Musicombo 4 ปีที่แล้ว +26

    This is pretty cool stuff! Is this your app or a fork of w0rthy's with your own improvements?

    • @CompilerStuck
      @CompilerStuck  4 ปีที่แล้ว +7

      Thank you! I wrote all code by myself, inspired by worthys and your videos

    • @Musicombo
      @Musicombo 4 ปีที่แล้ว +5

      @@CompilerStuck That's pretty rad, considering the inspirations shine through. Is this Java or Processing?

    • @CompilerStuck
      @CompilerStuck  4 ปีที่แล้ว +6

      @@Musicombo Well.. it's java, using Processing ;)

    • @Musicombo
      @Musicombo 4 ปีที่แล้ว +5

      @@CompilerStuck Cool! I gave you a shoutout on my channel. You deserve some attention :P

    • @CompilerStuck
      @CompilerStuck  4 ปีที่แล้ว +4

      Thank you! Means a lot to me :)

  • @CompilerStuck
    @CompilerStuck  ปีที่แล้ว +6

    Source Code available at: github.com/CompilerStuck/sorting-visualizer

  • @bethgerong4481
    @bethgerong4481 2 ปีที่แล้ว +9

    no one: minecraft loading screen creating a new world be like: 1:01

  • @Henqee
    @Henqee ปีที่แล้ว +8

    I like this so much! I tried to imitate it for my coding practice, but I am having trouble finding the distance between two elements. I could not see to connect the beginning and the end of the array;( If you don't mind, can you tell me how to do that?

    • @CompilerStuck
      @CompilerStuck  ปีที่แล้ว +7

      Hey! That sounds fun :)
      You gotta think about what you want to achieve by calculating the disparity:
      Finding the minimum distance between the elements original position, and the position it is currently moved to.
      So you gotta calculate the absolute distance in both ways, forward and backward, and select the smaller value of both
      That would translate to sth like this:
      min(abs(current_pos - org_pos), array_length - abs(current_pos - org_pos))
      I hope this help :) Have fun coding!

    • @Henqee
      @Henqee ปีที่แล้ว +4

      @@CompilerStuck Amazing! Thank you! It was helpful!

  • @Nick-40o
    @Nick-40o 4 ปีที่แล้ว +40

    Have the visualization be the word "Sort",and I'll watch your videos.

    • @ayamirisukahyejunghyuneuneun
      @ayamirisukahyejunghyuneuneun 4 ปีที่แล้ว +2

      Nick145 s8 m8

    • @dw2337
      @dw2337 ปีที่แล้ว

      Well that’s sus, how about the visualisation be the word fard and still watch his videos

    • @dw2337
      @dw2337 ปีที่แล้ว

      Watch his Videos all the time

    • @marianellasanchez6480
      @marianellasanchez6480 ปีที่แล้ว

      I know all the bases of the radix

    • @koshlandgov
      @koshlandgov ปีที่แล้ว

      @@dw2337 how can you visualize a word

  • @anatol_vaysla
    @anatol_vaysla ปีที่แล้ว +3

    3:23

  • @INTVEAYSLM2024
    @INTVEAYSLM2024 6 หลายเดือนก่อน +1

    i didnt feed my colors for one millisecond and now they TWEAKIN 💀💀💀💀💀💀😭😭😭😭😭⁉️⁉️⁉️⁉️😂😂😂😂😂

  • @yapwilson666hulksmash5
    @yapwilson666hulksmash5 2 ปีที่แล้ว +4

    0:25 The heart shaped

  • @naruhodoryuichi_daniel
    @naruhodoryuichi_daniel 2 ปีที่แล้ว +2

    I like this sound of sorting.

  • @mayzdev
    @mayzdev ปีที่แล้ว +3

    0:23 heart

  • @ashutoshmahapatra537
    @ashutoshmahapatra537 ปีที่แล้ว +2

    Odd even sort is like a fan 😂

  • @bonkser
    @bonkser ปีที่แล้ว

    can the particles go anywhere in the circle they get sorted into

  • @RichardsonDoesStuff
    @RichardsonDoesStuff 5 หลายเดือนก่อน

    *_Yellow, Cyan and Pink have left the chat._*

  • @paulmark992
    @paulmark992 5 หลายเดือนก่อน

    This sounds like an 80s video game

  • @yatsu5591
    @yatsu5591 2 ปีที่แล้ว +4

    This edible aint sh...

  • @andee2126
    @andee2126 8 หลายเดือนก่อน +1

    0:40 why does this remind me of a Minecraft music track called moog city

  • @kagechu2005BISVG
    @kagechu2005BISVG 2 ปีที่แล้ว +6

    0:35
    ain't no way
    1:55 also, 2x the speed for something else

  • @slimecraft656
    @slimecraft656 2 หลายเดือนก่อน

    0:39 that shape like flower

  • @KtmBowAndDavincifan
    @KtmBowAndDavincifan ปีที่แล้ว +2

    2:27 EMOJICAT

  • @glenndelacruz8157
    @glenndelacruz8157 ปีที่แล้ว +1

    2:22 giant eared

  • @engel1018
    @engel1018 ปีที่แล้ว +2

    0:33 this sounds like a song

  • @back22297
    @back22297 4 หลายเดือนก่อน

    This is how my moons orbit me

  • @fuchskindxdddd
    @fuchskindxdddd 2 ปีที่แล้ว +2

    how you instaledSorting Algorithm

  • @irapuanjuniorferreira7286
    @irapuanjuniorferreira7286 ปีที่แล้ว

    What app you use

  • @jimmykeech2467
    @jimmykeech2467 ปีที่แล้ว +1

    3:23 sounds like "setting sun" by chemical brothers

  • @irapuanjuniorferreira7286
    @irapuanjuniorferreira7286 10 หลายเดือนก่อน +4

    4:08 Selection sort 6:31 bubble sort 7:16 3:08 double selection sort

  • @Kids_Scissors
    @Kids_Scissors 2 ปีที่แล้ว +1

    damn, a whole lot of these just kinda look like the douboe selection sort

  • @Xcfxcfyes
    @Xcfxcfyes 7 หลายเดือนก่อน +1

    Gravity (bead) sort

  • @AdolfPickleBottom_42196
    @AdolfPickleBottom_42196 2 ปีที่แล้ว +2

    This feels really long but it's only 10 minutes

  • @kawkanat1616
    @kawkanat1616 4 หลายเดือนก่อน

    0:36 its like a song

  • @djEarrot
    @djEarrot ปีที่แล้ว

    “hey that girls cute! I wonder what she's listening to.“

  • @RobloxFan2518
    @RobloxFan2518 2 ปีที่แล้ว +4

    2:29 cat

  • @user-um7zf4le1p
    @user-um7zf4le1p ปีที่แล้ว +2

    0:01 Shuffling…

  • @pomidorka_
    @pomidorka_ ปีที่แล้ว

    why does it shuffle in such a strange way?

  • @jcfreak73
    @jcfreak73 6 หลายเดือนก่อน

    By what attribute are these points being sorted? It doesn't appear to be either position or color.

    • @CompilerStuck
      @CompilerStuck  6 หลายเดือนก่อน +1

      It is by color. They are arranged in a circular pattern.
      But each points distance from the center is defined by the distance to the points original position in the array -> Disparity

    • @jcfreak73
      @jcfreak73 6 หลายเดือนก่อน +1

      @@CompilerStuck got it! Thank you

  • @cjmentertainmentproductions
    @cjmentertainmentproductions ปีที่แล้ว

    How do you make these?

    • @CompilerStuck
      @CompilerStuck  ปีที่แล้ว +1

      I just published the Sorting Visualizer: github.com/CompilerStuck/sorting-visualizer

  • @maurolionelmipianoyyo11
    @maurolionelmipianoyyo11 2 ปีที่แล้ว +6

    If you use lsd radix sort base 10 then put 4 and 2

  • @zohnannor
    @zohnannor 2 ปีที่แล้ว +30

    I think pigeonhole sort is wrong

    • @zohnannor
      @zohnannor 2 ปีที่แล้ว

      yeah. you totally confused all the sorts

    • @Leviathan1132
      @Leviathan1132 2 ปีที่แล้ว +1

      Yeah

    • @CupisCupidity
      @CupisCupidity ปีที่แล้ว

      No they aren't

    • @zohnannor
      @zohnannor ปีที่แล้ว

      @@CupisCupidity can you show why?

    • @CupisCupidity
      @CupisCupidity ปีที่แล้ว +1

      @@zohnannor cuz the gravity of the earth rotates everything of colors and moons of madness is the best time to stay home and take you to the moon is the best time scrolling down the street is so good to stay strong and can form for the 1 quadrillion a joke is so much better than the world is the new the world end of a middle aged in bourbon and can form

  • @SuperDZ555
    @SuperDZ555 2 ปีที่แล้ว +5

    fnf fans be like: this goes so hard

  • @user-nj2vm2nj5j
    @user-nj2vm2nj5j 7 หลายเดือนก่อน +2

    What’s the game called

  • @wrigglel
    @wrigglel ปีที่แล้ว +1

    touhou attacks

  • @haidecanon2470
    @haidecanon2470 6 หลายเดือนก่อน

    Less segments?

  • @Alexverse672
    @Alexverse672 ปีที่แล้ว +1

    BEAD SORT 0:19

  • @LittleFarmLife1637
    @LittleFarmLife1637 ปีที่แล้ว +2

    Δ00:02:27 do you see "😻?"

  • @nikmrn
    @nikmrn 2 ปีที่แล้ว

    my brain during an exam

  • @anomalie3034
    @anomalie3034 3 ปีที่แล้ว +2

    gabber up!

  • @thtdrgnmn
    @thtdrgnmn 8 หลายเดือนก่อน +2

    0:23

  • @marianellasanchez6480
    @marianellasanchez6480 2 ปีที่แล้ว +2

    That sounds so weird

  • @HD_kev
    @HD_kev ปีที่แล้ว

    Cool

  • @mhyragaddi1866
    @mhyragaddi1866 ปีที่แล้ว +3

    0:00 1:00 2:00
    3:00 4:00
    5:00
    6:00
    7:00 8:00 9:00 10:00

    • @GCoHDC
      @GCoHDC ปีที่แล้ว +3

      When you use your mommy's phone too much

    • @jenniferpurfield9747
      @jenniferpurfield9747 8 หลายเดือนก่อน

      @bfdifan420 shut the up

  • @raffeld.afrinaldi8911
    @raffeld.afrinaldi8911 2 ปีที่แล้ว +1

    5:09 with shape strawberry lol

  • @belgium6788
    @belgium6788 ปีที่แล้ว

    Yellow, cyan, pink left the chat

  • @Xcfxcfyes
    @Xcfxcfyes 7 หลายเดือนก่อน

    Shell sort red medal

  • @Hello_flowly
    @Hello_flowly ปีที่แล้ว

    Odd even sort is based on emoji cat

  • @CutieFakeKirby
    @CutieFakeKirby 2 ปีที่แล้ว +1

    0:36 gottem

  • @joypascual7163
    @joypascual7163 7 หลายเดือนก่อน

    looks like number 8

  • @danceaw1
    @danceaw1 5 หลายเดือนก่อน

    0:06
    Am

  • @creusianemoraes6422
    @creusianemoraes6422 2 ปีที่แล้ว +1

    Double Sort!!!!!!!

  • @flomenmendoza1462
    @flomenmendoza1462 ปีที่แล้ว +1

    4:08

  • @pogixtiantocalo9616
    @pogixtiantocalo9616 2 หลายเดือนก่อน

    5:48

  • @haidecanon2470
    @haidecanon2470 6 หลายเดือนก่อน

    1279 segments?

  • @chaoscontrol2001
    @chaoscontrol2001 2 ปีที่แล้ว

    so i STILL don't know how the fuck gravity does that. shocker

  • @YourLocalBaconRblx
    @YourLocalBaconRblx 2 ปีที่แล้ว +2

    In 2:31, This shape looks like a cat.

  • @creusianemoraes6422
    @creusianemoraes6422 2 ปีที่แล้ว

    Neee Than nee!!!

  • @creusianemoraes6422
    @creusianemoraes6422 2 ปีที่แล้ว

    Max Heap Sort!!!!!

  • @minestudiolikelimelife8555
    @minestudiolikelimelife8555 7 หลายเดือนก่อน

    2:48 cat?

  • @RustyDogeNBee
    @RustyDogeNBee 11 หลายเดือนก่อน +1

    👍🏻👍🏻👍🏻

  • @martinefrensoquigomez7835
    @martinefrensoquigomez7835 6 หลายเดือนก่อน +1

    4:28 Mario Bros. when you beat a level