I'm a huge fan of the "estimated real time" counter, so I can see which sorts are actually faster! It's hard to tell a lot of the time, with different sorts being slowed down different amounts.
@@raynel1000 These are different sorting algorithims usually used by computers. Here's a TED-ED Video if you'd like to learn more. th-cam.com/video/WaNLJf8xzC4/w-d-xo.html
O(n) sorts are unreal But they aways have soe restrictions... Conting sort woks only when the numbers are in a known interval, and the larger the interval is slower is the algorithm
With a reasonable interval (let's say 1-1000000) it can be done in O(n) time. However as an integer's max absolute value is 2^32, those can't be counted in an array - one would use an associative container, like a map, instead. Since inserting an element into a map takes O(log n) time and one must insert n elements, the total complexity would be O(n log n), which is similar to (for example) quicksort or mergesort.
The odd-even sort and heap sorts look much more interesting in this mode than in other modes. Radix sorts are also more interesting because they convert several spirals into one spiral.
@@dorukayhanwastaken Check out the sorting network page on Wikipedia. You'll see that the graphs of the comparators show which groups of comparators can be done in parallel. Odd-Even can be done as a sorting network.
There are efficient sorts, there are impractical sorts, there are even beautiful sorts... Then there's that one sort that just decides to just go creative. 12:15
Parallel sorts are neat. They're often pretty inefficient on normal processors, but become extremely efficient when running on a GPU, where you can dispatch like 10000 simultaneous threads.
Just in case somebody wonders - angular position of a dot is a position in the array, the distance from the center is the magnitude of the number. When sorted, the magnitude is proportional to the angular position, hence spiral is formed. We start with a random array of numbers from 1 to 2048 (hence random pattern forming a circle).
This is definitely the coolest visual representation of sorting algorithms I’ve seen so far! You can really see the differences between the different algorithms, and a lot of them are pretty mesmerizing too!
I want one ranking sort speeds on initial arrays that are random, reverse sorted, almost sorted, etc., to show the strengths and weaknesses of various sorts. All these vids seem to just do random initial arrays.
I have no idea of what it's doing or why it's doing it, but watching it is oddly satisfying, so here I am. Also many of those graphics would make for nice loading screen backgrounds.
I notice that your dots are generated more often closer to the center-if you want a uniform circular distribution, generate them at a radius between 0 and 1 with a random angle, then for each point, take the square root of the radius. There's a marvelous proof that shows why this works that is too long to contain in the margins ;)
It's using polar coordinates, which means instead of "x" and "y", you specify their coordinates as an angle "theta", and a radius "r". The radius is their value, and the "theta" is their position in the array.
Radix is actually a rather intuitively way to sort, you basically compare the different digits, first caring about the smallest and working up from there
@@m.h.6470 Why not? They are both sorting algorithms in a sorting algorithm video. Wouldn't it be even more surprising that the longest one has less things to sort?
came 2 times at 9:43 and 9:49... Could you tell me more about the draw function? Its the Golden Spiral i think but how to draw this? Is 0 in the MIddle or on Top?
You can draw this using a polar coordinate System. Instead of coordinates you have an angle and a distance. If you now Plot the index of each element as your angle and the value as distance to the middle or the other way you get something like that.
@@VioletGiraffe im on my phone right now so i cant check, but if you are curious just make a screenshot and measure. compare distance at 360 degrees with 270 degrees. if the ratio between them is phi its golden.
for index and value pairs just do: map index values to angle: angle=2pi/maxindex*index map values to radius (or more correctly distance from center) such that growth rate is phi. (so over 1/2pi (90 degrees) the ratio of values is phi). radius=phi^(4*value/maxvalue) apply whatever scaling you need for desired spiral size. (this works for continuous values. if you have random numbers and want smooth spiral you need to pre-index them)
In 1973 I took my first college course in programming, and one of the topics we covered was sorting. I recently checked the programming courses offered by our local university (University of Hawaii) and found that their introductory course includes sorting as a topic. WHY? No one in their software engineering career ever has to design a new sort algorithm. No one has to understand the techniques and issues involved. It's a long-ago solved issue. Programmers need merely select a sort library and call the appropriate methods, if they even ever have a need to do any kind of sorting. There are so many, MANY new and interesting topics that could be made part of an introductory programming course in order to expose the student to the basics of programming and to expand their interest in programming. So why oh why is sorting still part of the curriculum? It just boggles the mind.
Awesome! It is just missing Stalinsort in the esoteric part x) !! (Stalin sort is a meme in O(n), basically you iterate through the list checking if it's in order, and if it isn't, you "kill" it by getting it off the list)
8:30 For In-Place merge sort, if the first element of the second sub array is lower than the first element of the first sub array, you move everything between where you are inserting that element and that element's index up one array index to make room for it in place. This requires no additional comparisons. The comparison count for In-Place merge sort should be no higher than normal merge sort.
This came on auto play after an asmr video. Really interesting to watch, not so interesting to try and comprehend what in the hell I was listening to without knowing what this is !
Gives you a glimpse into how blazingly fast computers are at their job; when dealing in milliseconds, most of these sorts would be instantaneous to the human eye in real time.
22:31 OK, this looks promising. Maybe it’s not that bad after all. That’s right! Keep up the great work, you can do this! You’re almost done, one last step away! Um, hello? HELLO??
Join our community Discord! discord.com/invite/2xGkKC2
Cool! Did you just pin this?
@@D144AU Yup, just pinned this!
ok
Huh what?
Bro I just posted a volume warning for radix sort base 16
I feel honored to be among the privileged few who got this in their recommended.
Same but I have no clue what it is still
@@bamdenie3466, the video is showcasing sorting algorithms with points on a spiral.
$5
Me too, sorta.
Yeah, even I gt here.
Other people: let's watch something I understand
Me: haha sorting algorithm go brrrrr
quality comment.
best comment i've seen in a looong time
wow you're so special
@@rigzmoviediaries654 see my balls
quirky 🤪😜 lol
I'm a huge fan of the "estimated real time" counter, so I can see which sorts are actually faster! It's hard to tell a lot of the time, with different sorts being slowed down different amounts.
Thank you!!
Exchange family
0:04 Bubble Sort
0:22 Cocktail Shaker Sort
0:37 Gnome Sort
1:05 Optimized Gnome Sort
1:22 Odd-Even Sort
1:41 Comb Sort
2:09 Quick Sort
2:22 Stable Quick Sort
2:43 Dual-Pivot Quick Sort
Selection family
3:05 Selection Sort
3:16 Double Selection Sort
3:28 Max Heap Sort
3:52 Min Heap Sort
4:17 Ternary Heap Sort
4:37 Weak Heap Sort
4:53 Smooth Sort
6:07 Tournament Sort
Insertion family
6:37 Insertion Sort
6:54 Binary Insertion Sort
7:12 Shell Sort
5:15 Cycle Sort
7:28 Patience Sort
Merge family
7:41 Merge Sort
8:30 In-Place Merge Sort
Non-comparison family
9:00 American Flag Sort, 256 Buckets
9:14 Bead (Gravity) Sort
9:40 Counting Sort
9:46 Pidgeonhole Sort
9:52 Radix LSD Sort, Base 4
10:22 In-Place Radix LSD Sort, Base 16
10:46 Radix MSD Sort, Base 8
11:08 Flash Sort
11:20 Shatter Sort
11:39 Simple Shatter Sort
12:00 Time Sort (Mul 4) [more widely known as Sleep Sort]
Sorting Networks / Concurrent family
12:16 Batcher's Bitonic Sort
13:11 Batcher's Odd-Even Merge Sort
Hybrids
13:34 Hybrid Comb Sort (Comb/Insertion)
13:55 Binary Merge Sort (Merge/Binary Insertion)
14:41 Weave Mergee Sort (Merge/Insertion)
15:34 TimSort
16:18 WikiSort (Block Merge Sort)
16:57 GrailSort (Block Merge Sort)
17:24 std::sort (Introsort)
17:46 Quick Shell Sort (Introsort with Shellsort)
18:06 std::stable_sort (Insert/Bottom-up Merge)
Esoteric / Fun
18:35 Pancake Sort
21:14 Stooge Sort
22:09 Bad Sort
22:30 Silly Sort
24:10 Slow Sort
25:51 Less Bogo Sort
27:10 Cocktail Bogo Sort
28:37 Bogo Sort
thx
What is this video? I have no idea what im watching
@@raynel1000 These are different sorting algorithims usually used by computers. Here's a TED-ED Video if you'd like to learn more. th-cam.com/video/WaNLJf8xzC4/w-d-xo.html
@@raynel1000 different logic style shit for computers to Read/Write/sort ect.
@@raynel1000 a visual representation of algorithms to sort objects, mainly used for numbers but I guess it works for anything
9:39 counting sort is unreal
Pigeonhole sort was even better
O(n) sorts are unreal
But they aways have soe restrictions...
Conting sort woks only when the numbers are in a known interval, and the larger the interval is slower is the algorithm
With a reasonable interval (let's say 1-1000000) it can be done in O(n) time. However as an integer's max absolute value is 2^32, those can't be counted in an array - one would use an associative container, like a map, instead. Since inserting an element into a map takes O(log n) time and one must insert n elements, the total complexity would be O(n log n), which is similar to (for example) quicksort or mergesort.
Counting sort is good for numbers, but if you’re sorting complex objects, it’s pretty useless.
That makes sense, counting numbers is pretty quick and easy
The odd-even sort and heap sorts look much more interesting in this mode than in other modes. Radix sorts are also more interesting because they convert several spirals into one spiral.
and comb
Now if only odd-even wasn't _so. fucking. slow._ Is it meant for hardware like gravity sort?
@@dorukayhanwastaken Odd-Even Sort is meant for parallel processing, where each element is processed independently on a CPU core.
@@dorukayhanwastaken Check out the sorting network page on Wikipedia. You'll see that the graphs of the comparators show which groups of comparators can be done in parallel. Odd-Even can be done as a sorting network.
12:58 The algorithm is forming a heart
Or a breast
3 types of people
4 types
this reply chain reads like a fucking tumblr post
Or a squished orange.
This quarantine is making me watch some strange stuff
We probably reach the end of the youtube algorithme proposition
Same
I watch youtube like 12 hours per day because of the quarantine
😂😂😂
Yeah bro, I m italian it s my 19th day of quarantine, qurantine in my city started 7th march. You will live some really strange stuff
There are efficient sorts, there are impractical sorts, there are even beautiful sorts...
Then there's that one sort that just decides to just go creative.
12:15
❤️
Parallel sorts are neat. They're often pretty inefficient on normal processors, but become extremely efficient when running on a GPU, where you can dispatch like 10000 simultaneous threads.
I was sitting here thinking “why is it making leaves?”
and then theres 10:23
@@c0zmozys most menacing sort
9:50 for radix sorts
Thanks!
got an ad
There is no Radix Base 10...
Yo what that's cool
I doubt there is an easy explenation on how it works, is there?
My days of watching sorting algorithms has paid off to show me even more sorts
Are ya winning son
Silly sort: takes 18 actual seconds
Me: yea seems pretty silly
18 seconds with 256 dots, with 2048 dots it would still be running.
silly sort be like: lol nyeh nyeh nyeh I'm silly woooo yoohoo blbllbbllblblblb hahaha im a silly guy look at me
Slow sort: takes even longer
16:44 The demonetization sort
Oof.
why am i watching sorting algorithms again?
Same
Because Google said so.
Because the TH-cam Algorithm says so.
The real question is, why not?
Cause this one is cool and different because it visualizes it with Fibonacci spirals instead of just the regular bar graph style ones
28:36
I'm so proud of Bogo :)
It finally finished sorting something!
bogo hours
@@mono_si how hours
Was it seriously first try?
Bogos binted
3:18 sounds and looks like a slow motion Pac-Man death.
At the beginning of the sound it also looks like Pac-Man
It does indeed!
yo that's true! how'd you notice that!!
More like 4:54
It looks like a pac man death too
11:10 When you know the answer to a problem but you don't feel like showing your work
1.8ms
LMFAO
Radix LSD bases/sorts family
9:54 Radix LSD Sort, Base 4
10:23 in-place Radix LSD Sort, Base 16
10:47 Radix LSD Sort, Base 8
in-place is mind boggling
Radix sorts are always my favourite when visualized
10:47 Radix *MSD* Sort
@@toyama3307 samree
10:21 - My nervous system when I hit my elbow
Perfect. Somehow that just works. Have a good day.
these are always so accurate
Ooof.
*Ae* U *Ꮐ* h
10:10 Radix sort is just BEAUTIFUL.
16:17 is my favorite, because it moves like an indecisive clock and also draw a curvy swastika in the process for some reason
Sylvester Markotzki least favorite*
@@p0tatogod533 nooooooooooooo you cant say swastika nooooooooooo
Found the nazi
Hey, Nazis gotta sort things, too!
@@p0tatogod533 most favorite*
10:24 That sound when I microwave my baked potato with the tin foil still on
Just in case somebody wonders - angular position of a dot is a position in the array, the distance from the center is the magnitude of the number. When sorted, the magnitude is proportional to the angular position, hence spiral is formed. We start with a random array of numbers from 1 to 2048 (hence random pattern forming a circle).
This is definitely the coolest visual representation of sorting algorithms I’ve seen so far! You can really see the differences between the different algorithms, and a lot of them are pretty mesmerizing too!
16:44 boutta get demonetized
Thought the same
Thought the same
Thought the same
Thought the same
Thought the same
Unpopular Opinion (maybe):
Bubble sort will always look freaking awesome no matter what.
comb sort is so much more pleasant to watch in this format
Did I just watch a computer sort dots for 30 minutes?
Yes I did.
The min heap sort ending at 4:08 is unbelievably satisfying.
my boi Radix LSD Sort out here absolutely PERFORMING as always
I wish someone would make a sort video that would give a short explanation of how each sort worked.
Might do that in the future!
@@Musicombo Did you? It's been a while
I want one ranking sort speeds on initial arrays that are random, reverse sorted, almost sorted, etc., to show the strengths and weaknesses of various sorts. All these vids seem to just do random initial arrays.
My grandkids listen to this soothing music every day. They are so happy they are jumping arround on the floor. Truly life-changing.
I like the moment it drew a 6
not a 6 I think
Is this ART?
: SORT of...
this has to be the coolest way possible to visualize the radix sorts (9:52) and Batchers bitonic sort (12:16)
I have no idea of what it's doing or why it's doing it, but watching it is oddly satisfying, so here I am.
Also many of those graphics would make for nice loading screen backgrounds.
12:20 is the best, from flowers to ass. It drew everything.
28:24 My arm after it falls asleep
3:16 RIP pacman
Can you graze them though?
genius
incredible
i can't begin to stress just how cool in-place radix lsd sort looks here
7:27 what happend ? o.o
it's like, it was just looking around and suddenly figured out the right order lmao
9:37 is even better lmao
-you are already dead.
-nani?
it was ordering them elsewhere, and when it was ready just copied it to the visualized array
Zahid 😂 this is sooo epic man
Myles 9:45 is better
Fun fact: you can only be recommended this video, you’ll never see it otherwise
Don't know why, but this is one of the most relaxing videos on YT for me.
Thank you!!
12:17 is beautifull and i have no clue what that computer is doing
10:00 ok this is beautiful!
Lsd sort
1:42 - Salvador Dali combing his moustache
10:24 The language of the gods
Sounds like it came from nier Automata
PS2 start up
well it has LSD in its name
That's my jam.
I notice that your dots are generated more often closer to the center-if you want a uniform circular distribution, generate them at a radius between 0 and 1 with a random angle, then for each point, take the square root of the radius. There's a marvelous proof that shows why this works that is too long to contain in the margins ;)
May I ask how this visualize works? The distance between dots and center is their value but how to determine their coordinance in a 2d plane?
(v sin(2tπ/a), v cos(2tπ/a))
With
v=dot's value,
t=dot's position in array, starting with 0
a=array's length - 1
You guys got it!
It's using polar coordinates, which means instead of "x" and "y", you specify their coordinates as an angle "theta", and a radius "r". The radius is their value, and the "theta" is their position in the array.
I leave this under every video I watched, it helps the algorithm.
9:52 this and next one, crazy visuals! love it!
11:08 extremely fast
9:00 muricuh
I love how stooge sort feels out the rest of the shape to make sure everything is in order at the end
he wants to get the job done right
how girls sort things out 9:39
how boys sort things out 10:22
how i sort things out 25:50
how i sort things out: 18:35
I love how this implies you're neither boy or girl
Radix is actually a rather intuitively way to sort, you basically compare the different digits, first caring about the smallest and working up from there
alexander grimley
That which has no life cannot be assigned a gender.
I should know. I have no life, and thus I’m just a lifeless object. 🧱
How I sort things out: 28:37
This is the visualization of what I program to do in terms of sorting for school. Glad to see this satisfying video.
16:43 *Banned in Germany*
Ah yes, the classic swirl dot visualization. I see you are a man of culture.
It's crazy how different the duration's of these algorithms can be. From 0.484ms (9:46) to over 8 seconds (12:00), even up to over 18 seconds (22:30)
you did realize, that the 18 seconds one actually only has 256 values, while the other two have 2048 values, right?
@@m.h.6470 Yeah... so? What's your point?
@@Niscimble The point is, that you can't compare them directly like you did.
@@m.h.6470 Why not? They are both sorting algorithms in a sorting algorithm video. Wouldn't it be even more surprising that the longest one has less things to sort?
@@Niscimble it's like comparing two motorcycles with a bicycle ... sure, you can do it, but it is stupid and doesn't really tell you anything.
Pidgeonhole sort: You're weak.
Counting sort: I'm You.
I love your vids! Keep making them. (:
Thanks!
cocktail shaker looks like you're closing an interdimensional rift
came 2 times at 9:43 and 9:49... Could you tell me more about the draw function? Its the Golden Spiral i think but how to draw this? Is 0 in the MIddle or on Top?
You can draw this using a polar coordinate System. Instead of coordinates you have an angle and a distance. If you now Plot the index of each element as your angle and the value as distance to the middle or the other way you get something like that.
@@-flxwly-1549 i love you. thanks
I was just about to ask what kind of a spiral this is. Is it really a golden spiral?
@@VioletGiraffe im on my phone right now so i cant check, but if you are curious just make a screenshot and measure. compare distance at 360 degrees with 270 degrees. if the ratio between them is phi its golden.
for index and value pairs just do:
map index values to angle:
angle=2pi/maxindex*index
map values to radius (or more correctly distance from center) such that growth rate is phi. (so over 1/2pi (90 degrees) the ratio of values is phi).
radius=phi^(4*value/maxvalue)
apply whatever scaling you need for desired spiral size.
(this works for continuous values. if you have random numbers and want smooth spiral you need to pre-index them)
My teachers: he’s so smart he will go places in life
Me on top of my roof: 0:04
Wow, the diference in speed between some methods is astounding.
Counting and pidgeon sort be like: uhm, guys Tf are you doing? Just skip everything and draw the thing.
In 1973 I took my first college course in programming, and one of the topics we covered was sorting. I recently checked the programming courses offered by our local university (University of Hawaii) and found that their introductory course includes sorting as a topic. WHY? No one in their software engineering career ever has to design a new sort algorithm. No one has to understand the techniques and issues involved. It's a long-ago solved issue. Programmers need merely select a sort library and call the appropriate methods, if they even ever have a need to do any kind of sorting. There are so many, MANY new and interesting topics that could be made part of an introductory programming course in order to expose the student to the basics of programming and to expand their interest in programming. So why oh why is sorting still part of the curriculum? It just boggles the mind.
6:08 my favorite part of the series: the tournament arc
I think Batcher's Bitonic Sort is my favorite out of these since it drew such interesting pictures.
Not sure what made me end up watching a bunch of sorting algorithms visualization vids, but I like it
Ah nothing beats cottage life and sorting algorithms with the boys
28 minutes of sorting.
What is this, heaven?
3:17 Oh, that's PAC-Man! Both visually and audibly. Interesting!
Wow
been watching these for the last 2 months every now and then, no idea what im looking at but lets fucking go
Girl: Hi
My Brain: 10:23
Me: Potato
true shit
Random = funny
mega lol xD
@@antttt8805 potato
I don't know what this is used for but it makes me happy.
10:22 this one gave me anxiety
Jay Bivins well, it has LSD in the name
@@leiph Least significant digit
It made me tilt my head
@@wladfan still LSD
Other sort : *doing their best to make it under a second*
Silly Sort : I'm trying to reach a minute here
Slow Sort : It's in my name
Awesome! It is just missing Stalinsort in the esoteric part x) !!
(Stalin sort is a meme in O(n), basically you iterate through the list checking if it's in order, and if it isn't, you "kill" it by getting it off the list)
8:30
For In-Place merge sort, if the first element of the second sub array is lower than the first element of the first sub array, you move everything between where you are inserting that element and that element's index up one array index to make room for it in place. This requires no additional comparisons. The comparison count for In-Place merge sort should be no higher than normal merge sort.
Ahh, so basically galaxys are just trying to sort theirself with odd even sort...
12:59 happy valentines day :v
dates a computer
I literally watched 4 and a half minutes of this before even pausing and looking at the comments
great, we have a program that can sort my spilled rice if i ever feel lazy
I don't know what this is, but for some reason i enjoy it
What the hell is Silly Sort doing? Comparisons for the fun of it?
It's doing its best.
@@TheRealBatabii 22:30
@densch123 that is bogo sort
@densch123 That was the very last one with eight values. 22k comparisons, 102k swaps, 206k writes to array
FOR EIGHT
This came on auto play after an asmr video. Really interesting to watch, not so interesting to try and comprehend what in the hell I was listening to without knowing what this is !
Different methods to sort things
woaw this is so fascinating , the sound effect is also astonishing. i hope they make more of this
Got this recommended after watching some touhou music
Is this a spellcard attack?
Same
American flag: amma best
Counting sort: hold my beer
Pigeonhole: you're not allowed to drink beer yet, kid
9:28 had me ROLLING!
Gives you a glimpse into how blazingly fast computers are at their job; when dealing in milliseconds, most of these sorts would be instantaneous to the human eye in real time.
As Frozone would say,
WHERE IS MY BOGOSORT!
i sexually identify as a bogo sort
12:16 When you arrive at the solution of a test question despite having absolutely no idea how you got there
Why is the volume super low even on 150% volume
Screwed up my OBS settings on this batch of videos. Oops.
@@Musicombo oh ok maybe you can fix it
@@BonesTH-cam It's fixed in my later batch of videos!
3:18 when a big orange ghost touches you
I read it as "50 Sports Visualized" and couldn't figure out why the data was converging to a golden ratio
All is one, one is all .
Who is this taking notes of how viewers behave ? That is some interesting database you have :)
12:59 - Damn, Batcher's Bitonic Sort's lookin' THICC 🍑
22:31 OK, this looks promising. Maybe it’s not that bad after all. That’s right! Keep up the great work, you can do this! You’re almost done, one last step away! Um, hello? HELLO??
*girls during puberty* : my period cramps hurt
*boys during puberty* : 2:02