*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 - Наука та технологія
Visit the channel Discord here: discord.com/invite/2xGkKC2
Don't invite just ignore
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!
god that bubble sort curve is clean asf
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.
Optimized Gnome do be making great music doe
Timstamp?
@@-AAA-147 2:02
@@daffa_fm4583 thx
Lourd Parker Pardillo 100 gecs
8:06 Cyclesort is rather fast than other shuffles :O
Yeah right
It's like selection sort for a few seconds and then it just does cycle sort
This is one of the most interesting arrays ones. Its like they all just look the same but doing it differently.
This is art. Mark Rothko wishes a blue rectangle on top of a red rectangle was as thought-provoking as this.
The shape during the sorting process is like random but it's always the cleanest
There were a lot of pentatonic scales in this video!
Also augmented chords and mostly septatonic scales
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.
Awesome!!
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.
David Eikeland Signed, yes. I think they meant unsigned, though.
@@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.
For those wondering where Pancake Sort is, it's at 44:30
Nice!
17:29 has to be the quickest merge sort
It's not; check how many comparisons and swaps it does!
I don't think it's accurate to say in-place sorts are slow...
In visual time that is
i think the "bit reversal" is the "perfect shuffle" because most thingslike bubble sort curves and distribution among merge sort sublists is near-perfect.
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.
22:36 sounds like shepherd tone
that's because it technically is
PERFECT QUICK SORT
Bogobogo sort bears higher operation numbers than Frieza’s power level on Namek.
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.)
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?
@@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.
21:17 is gravity sort
Uhh what are you planning then@@Musicombo
Its been 4 years dude @@Musicombo
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
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
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
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
Concurrent Sorts
25:31 Batcher’s Bitonic Sort
26:47 batcher’s odd-even Merge sort
22:21
Thank you :)
Love it! Needs time codes!
Time stamps*
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;
}
@@SuperBee3 Don't spam my comments section, thanks.
@@Musicombo no
@@SuperBee3 Okay, then I'm just gonna remove your comments.
@@Musicombo stop it
@@Musicombo Your grounded
For some reason, circle sort is similar to (iterative) MSD radix sort
Worst Bogobogo performance on these sort comps I've seen thus far. Nearly ten seconds just for 6 numbers!
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
RAWBOOT the tree sub bot god uhh what
Why do you post things like that under a sorting video?
we did not want to know this
@@nameisChannelID what-
w h a t
Sort #67 really did find the pattern lmao it was twice as fast as std::sort!
Watching this whole video made my phone overheat and feel like my phone is on fire
Sounds like a software or hardware problem; it's nothing my videos could have done.
April fools is what 5heyre doing@@Musicombo
the least random shuffled array
Ye
I feel like circle sort is a mutated quick sort (no offense to the guy who created it.)
Or a sorting network trying to be a quicksort
What time complexity is in place merge sort?
O(n²) avg and worst, O(n log n) best
A.k.a
Pubic hair inputs
What's the difference between gnome sort and insertion sort?
Swaps vs. overwrites!
Ah, okay. Thx!
28:56 hahahahaha
Tesla Coil hahaha
In-place Merge sort is not really that effective...
sixst bot not cear