*SEIZURE WARNING* Over 70 Sorting Algorithms in Under an Hour - Bit-Reversed Inputs

Поділитися
Вставка
  • Опубліковано 23 лип 2020
  • A "bit-reversal" is when you take the binary digits of a number and "flip" them to the other "side" of the digits, e.g. 1100 in binary (12 in base-10) becomes 0011 in binary (3 in base-10). See www.researchgate.net/profile/... for an example. Bit-reversals come up a lot in things such as digital signal processing (think audio recordings), and more specifically in FFTs (Fast Fourier transforms)!
    Special thanks to Jervin Sevilla ( / @jervinsevilla6677 ) for suggesting this idea!
    This turned out to be quite an interesting video!! I hope you enjoy. :)
    Check out the program here: github.com/MusicTheorist/Arra...
    Visit the channel Discord here: / discord
    Check out the Mother 1+2 Restoration project: / discord
  • Наука та технологія

КОМЕНТАРІ • 87

  • @Musicombo
    @Musicombo  3 роки тому +4

    Visit the channel Discord here: discord.com/invite/2xGkKC2

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

      Don't invite just ignore

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

      for int ¡¿r
      if w/r=r
      reverse/bit=console(len=i(iola in if array.write(software=true)+array.swap(software=true)
      setiolao(software=false)
      setiola(rod+(5/$e))
      else iola\pig(🐖🐷🐽)
      else
      \setrod"sussy(🐽)+iola*rod*$e\
      while not(r)
      /r🤣_🤣-/
      *trp=w/
      rut
      ren
      if rod^$e=0
      medicine(🕳️)
      else ¡69!

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

    god that bubble sort curve is clean asf

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

    For as often as quick L/L struggles in these videos compared to other quick sort implementations, it's really nice to see it get through a sort with relative ease for once.

  • @ayamirisukahyejunghyuneuneun
    @ayamirisukahyejunghyuneuneun 3 роки тому +16

    Optimized Gnome do be making great music doe

  • @alsrl6710
    @alsrl6710 3 роки тому +16

    8:06 Cyclesort is rather fast than other shuffles :O

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

    This is one of the most interesting arrays ones. Its like they all just look the same but doing it differently.

  • @scitechian
    @scitechian 3 роки тому +5

    This is art. Mark Rothko wishes a blue rectangle on top of a red rectangle was as thought-provoking as this.

  • @smaybius
    @smaybius 9 місяців тому +1

    The shape during the sorting process is like random but it's always the cleanest

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

    There were a lot of pentatonic scales in this video!
    Also augmented chords and mostly septatonic scales

  • @samwalko
    @samwalko 3 роки тому +9

    Might mention that doing a bit-reversal then adding one is how to negate a number in two's-complement.
    Edit: made this comment before I saw pancake sort. First of all, that behavior was beautiful, but second of all, it was due to the fact above, and ngl kind of proud of knowing that.

    • @Musicombo
      @Musicombo  3 роки тому +1

      Awesome!!

    • @canaDavid1
      @canaDavid1 3 роки тому +1

      Not exactly. F.ex if i have 3 (00000011) the negative of it would be 11111101, since
      ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹
      00000011
      +11111101
      =00000000.
      If it was bit-reversed, 3 would become 11000001. That is -63.

    • @_fluffyy1028
      @_fluffyy1028 3 роки тому +1

      David Eikeland Signed, yes. I think they meant unsigned, though.

    • @samwalko
      @samwalko 3 роки тому +3

      @@canaDavid1 You're right and now I'm disappointed (but my comment isn't entirely wrong). From the description, I assumed bit-reversal was another term for inverting bits, because for 0011 that results in 1100. If you add one, as noted in my previous comment, then you get 1101 = -8 + 4 + 1 = -3. But if bit reversal is actually reversing the order of the bits, not inverting/negating them, then never mind.

    • @JetFalcon710
      @JetFalcon710 8 днів тому

      For those wondering where Pancake Sort is, it's at 44:30

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

    Nice!

  • @nooby987
    @nooby987 3 роки тому +6

    17:29 has to be the quickest merge sort

    • @Musicombo
      @Musicombo  3 роки тому +5

      It's not; check how many comparisons and swaps it does!

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

      I don't think it's accurate to say in-place sorts are slow...

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

      In visual time that is

  • @ishu4227
    @ishu4227 17 днів тому

    i think the "bit reversal" is the "perfect shuffle" because most thingslike bubble sort curves and distribution among merge sort sublists is near-perfect.

    • @ishu4227
      @ishu4227 17 днів тому

      Quick sort partitions are also perfectly split by the center, circle sort passes also split by the center, for each sublist, Heaps also sizes that are powers of two, etc.

  • @Deseptor
    @Deseptor 3 роки тому +3

    22:36 sounds like shepherd tone

    • @not_estains
      @not_estains 23 дні тому

      that's because it technically is

  • @not_estains
    @not_estains 23 дні тому

    PERFECT QUICK SORT

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

    Bogobogo sort bears higher operation numbers than Frieza’s power level on Namek.

  • @samwalko
    @samwalko 3 роки тому +6

    Unrelated to my previous comment (hence a new one), I've got some questions about the sorts shown here.
    First of all, wasn't there another distribution sort? Gravity sort or something?
    Second of all, are you planning on adding a balanced tree sort? If so, will it be an AVL tree or red-black tree? (Iirc, Java's Arrays.treesort uses red-black trees.)

    • @Musicombo
      @Musicombo  3 роки тому +3

      All distribution sorts in ArrayV should be featured in this video!
      And I would love to, but I'm not sure which tree it will be. Perhaps both?

    • @scitechian
      @scitechian 3 роки тому

      @@Musicombo Red-Black is the tree used internally by Java's TreeMap and TreeSet, and I think the Linux kernel uses Red-Black for some internal OS data structures as well. AVL is more of theoretical interest than practical interest; the rebalancing logic is far more complex for comparatively little extra "balanced-ness" benefit.

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

      21:17 is gravity sort

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

      Uhh what are you planning then​@@Musicombo

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

      Its been 4 years dude ​@@Musicombo

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

    Exchange Sorts
    0:02 Bubble Sort
    0:26 Optimized Bubble Sort
    0:39 Cocktail Shaker Sort
    1:02 Optimized Cocktail Shaker Sort
    1:21 Odd-Even Sort
    1:38 Gnome Sort
    2:02 Optimized Gnome Sort
    2:19 Optimized Gnome Sort + Binary Search
    3:26 Comb Sort
    3:43 Circle Sort
    4:54 Quick Sort (Left Left Pointers)
    6:00 Quick Sort (Left Right Pointers)
    6:37 Dual Pivot Quick Sort
    7:15 Stable Quick Sort

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

      Selection Sorts
      7:36 Selection Sort
      7:55 Double Selection Sort
      8:07 Cycle Sort
      8:39 Max Heap Sort
      9:08 Min Heap Sort
      9:37 Flipped Min Heap Sort
      10:07 Weak Heap Sort
      10:36 Ternary Heap Sort
      11:07 Smooth Sort
      11:42 Poplar Heap Sort
      12:11 Tournament Sort

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

      Insertion Sorts
      12:39 Insertion Sort
      13:03 Binary Insertion Sort
      14:11 Shell Sort
      15:00 Patience Sort
      15:19 Unbalanced Tree Sort
      Merge Sorts
      15:40 Merge Sort
      16:34 Bottom-up Merge Sort
      17:29 In-place Merge Sort
      17:42 Lazy Stable Sort
      19:56 Rotate Merge Sort

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

      Distribution Sorts
      20:53 Counting Sort
      21:03 Pigeon Hole Sort
      21:14 Gravity Sort
      21:28 American Flag Sort 128 Buckets
      21:49 LSD radix Sort Base 4
      22:20 In-place LSD radix Base 10
      22:48 MSD radix Base 4
      23:25 flash sort
      23:42 Iterative Binary Quick Sort
      24:13 Recursive Binary Quick sort
      24:42 shatter sort
      24:57 Simple Shatter Sort
      25:22 Timesort, Mul 10

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

      Concurrent Sorts
      25:31 Batcher’s Bitonic Sort
      26:47 batcher’s odd-even Merge sort

  • @ayamirisukahyejunghyuneuneun
    @ayamirisukahyejunghyuneuneun 3 роки тому +8

    22:21

  • @dazraf
    @dazraf 3 роки тому

    Love it! Needs time codes!

  • @scitechian
    @scitechian 3 роки тому +3

    for( int i = 0, j = 0; i < currentLen; i++ ){
    if( i < j && j < currentLen ){
    Writes.swap(array, i, j, 0, true, false);
    }
    int mask = i ^ (i + 1);
    int rev = currentLen / (mask + 1);
    j ^= currentLen - rev;
    }

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

      @@SuperBee3 Don't spam my comments section, thanks.

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

      @@Musicombo no

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

      @@SuperBee3 Okay, then I'm just gonna remove your comments.

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

      @@Musicombo stop it

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

      @@Musicombo Your grounded

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

    For some reason, circle sort is similar to (iterative) MSD radix sort

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

    Worst Bogobogo performance on these sort comps I've seen thus far. Nearly ten seconds just for 6 numbers!

  • @rainfrog
    @rainfrog 3 роки тому +9

    Dolphins will sometimes play kind of an underwater volley ball using infant dolphins as a ball, and hit them so hard with their tail fins that the infants burst and die

    • @m3m3b0y2
      @m3m3b0y2 3 роки тому +4

      RAWBOOT the tree sub bot god uhh what

    • @Unknown-ho9wt
      @Unknown-ho9wt 3 роки тому +2

      Why do you post things like that under a sorting video?

    • @nameisChannelID
      @nameisChannelID 3 роки тому +1

      we did not want to know this

    • @icebearpl188
      @icebearpl188 3 роки тому

      @@nameisChannelID what-

    • @cagegirll
      @cagegirll 3 роки тому

      w h a t

  • @hellobye9178
    @hellobye9178 3 роки тому +1

    Sort #67 really did find the pattern lmao it was twice as fast as std::sort!

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

    Watching this whole video made my phone overheat and feel like my phone is on fire

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

      Sounds like a software or hardware problem; it's nothing my videos could have done.

    • @truongquangduylop33
      @truongquangduylop33 7 годин тому

      April fools is what 5heyre doing​@@Musicombo

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

    the least random shuffled array

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

    I feel like circle sort is a mutated quick sort (no offense to the guy who created it.)

    • @smaybius
      @smaybius 9 місяців тому

      Or a sorting network trying to be a quicksort

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

    What time complexity is in place merge sort?

    • @smaybius
      @smaybius 9 місяців тому

      O(n²) avg and worst, O(n log n) best

  • @icebearpl188
    @icebearpl188 3 роки тому

    A.k.a
    Pubic hair inputs

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

    What's the difference between gnome sort and insertion sort?

  • @mjthebest7294
    @mjthebest7294 3 роки тому +8

    28:56 hahahahaha

  • @Fera-gr5mm
    @Fera-gr5mm 3 роки тому

    In-place Merge sort is not really that effective...

  • @ayamirisukahyejunghyuneuneun
    @ayamirisukahyejunghyuneuneun 3 роки тому

    sixst bot not cear