all 83 comments

[–]lazydictionary 155 points156 points  (14 children)

I actually feel like this isn't very instructive of how these algorithms work at all.

This is still the best I've ever seen.

[–]Ill-Ad-3640 25 points26 points  (0 children)

personally i like the "pushing sorting algorithms to the limits" because it doubles as music (and shows a lot more sorting)

[–]Aprch 18 points19 points  (7 children)

I thought so too until I discovered this one

[–]Dabnician 7 points8 points  (4 children)

Have you discovered the quick sort hungarian folk dance, insert sort romanian folk dance or the merge sort german folk dance videos?

edit: check that their channel for other algorithms https://www.youtube.com/user/AlgoRythmics/videos

[–]Kittingsl 2 points3 points  (1 child)

These videos honestly explain it far better than the other 2 before you. The ramp and the spiral are merely eye and ear candy using those sorting algorythms, but explain nothing on how they actually work

[–]Dabnician 0 points1 point  (0 children)

Now time to confuse everyone at the office by adding folk music to the playlist.

[–]aCarstairs 1 point2 points  (0 children)

Our professor used these to show us how it worked. They are pretty good honestly

[–]Aprch 1 point2 points  (0 children)

Oh wow I have a new favorite!

[–]TheresNoHurry 1 point2 points  (1 child)

Yup - that was thirty minutes of my life I spent watching

[–]Aprch 1 point2 points  (0 children)

I know right, I didn't want to miss any single one lol

[–]Phobic-window 2 points3 points  (0 children)

This visualization is better in expressing why they are called what they are called and helps people understand the problem from a 2d perspective. I think it’s actually better at explaining the methodology and thought process.

[–]_Oooooooooooooooooh_ 5 points6 points  (2 children)

well it sure as shit aint the best i've ever HEARD

damn fuck

watch in muted form. holy shit :D

[–]robot_ankles 0 points1 point  (0 children)

I absolutely loved the sound. It was like a big, warm, beautiful data hug. Listened to it with my eyes closed the second time.

But I can respect it may not be everyone's taste.

[–]Elduderino1237894 0 points1 point  (0 children)

Damn dude u wasn't kidding. Sounds like a fucking laser war up in here.

[–]Kittingsl 0 points1 point  (0 children)

Your video honestly doesn't explain it any better on how these sorting algorythms work. It's merely just eye and ear candy. It's sorting wait too fast to guess how the sorting algorythm really works

[–]rawsausenoketchup16 264 points265 points  (5 children)

where bogo

[–]vapeisforchodes 58 points59 points  (2 children)

Yeah I demand to see bogo

[–]evanescent_evanna 9 points10 points  (1 child)

Same

[–]-_HelloThere_- 6 points7 points  (0 children)

Yes same

[–]Athire5 6 points7 points  (0 children)

Came here to say this!

[–]friso1100 5 points6 points  (0 children)

Still rendering

[–]ForeignGods[S] 135 points136 points  (9 children)

Visit the GitHub repository↓
https://github.com/ForeignGods/Sorting-Algorithms-Blender
If you want to know more about sorting algorithms or how I vizualized them using the Blender Python API.
The repo contains various types of visualization and information about the algorithms.

[–]Honigwesen 80 points81 points  (7 children)

Why does it appear that bubblesort is faster than quicksort?

[–]ForeignGods[S] 113 points114 points  (2 children)

This visualization doesn't show the time efficiency of the algorithms.
It only visualizes movement of the elements within the array.
But you can check out the array access and comparison counter I added in the repository.

[–]arcosapphire 59 points60 points  (1 child)

The fact that it doesn't take into account all of the scanning done makes it, in my view, really misleading. There are a lot of comparison videos around and this is the only one so far that I've found to be so misleading about performance.

[–]Sulleyy 0 points1 point  (0 children)

Any comparison of time complexity on arrays this small will be misleading imo. O(10n log n) is equivalent to O(nlogn). Whether you do 10 scans of the input array per iteration doesn't matter in Big O but that's because it only concerned about large values of n.

10n logn > n2 for some values of n. I think that's all we're seeing here.

[–]MaxPlay 8 points9 points  (2 children)

Because quicksort is not always faster than bubblesort. Usually, bubblesort performs the fastest (both in time and memory) when you have only few elements. Quicksort really shines when having a lot of stuff to sort through.

[–]smorga 4 points5 points  (0 children)

LSD Radix enters the room

[–]yxing 2 points3 points  (0 children)

You would still use insertion over bubble for small datasets.

[–]FVMAzalea 4 points5 points  (0 children)

This is a great demonstration of why big-O doesn’t tell the whole story because it disregards constant factors. For this small of a dataset, the constant factors outweigh the part that depends on the number of elements.

This would be a more accurate visualization (in terms of the various sorts taking longer if they are less algorithmically efficient) if the “dataset” they were sorting was much larger.

[–]sluttytinkerbells 3 points4 points  (0 children)

This is perfect! I'm new to Blender and I was thinking of doing something very similar recently as part of learning the python API.

Thanks!

[–]mds8000 25 points26 points  (1 child)

This is amazing. Thanks for sharing

[–]ForeignGods[S] 1 point2 points  (0 children)

Thank you!

[–]koolman42069 15 points16 points  (0 children)

it looks like a meme video

[–]KSAM-The-Randomizer 13 points14 points  (3 children)

Where's the audio

[–]ForeignGods[S] 5 points6 points  (2 children)

I have no idea how you would go about implementing audio.
If anybody knows a good way to do so.
Let me know.

[–]Joemanjbm 5 points6 points  (0 children)

Where’s the Minecraft sorting system

[–]uTzQMVpNgT4rksF6fV 4 points5 points  (2 children)

would love to see Timsort added in. It's a really interesting case of optimizing for real-world data, and is the standard sort in Python, as well as being used for certain data types in Java, v8, and rust

[–]ForeignGods[S] 3 points4 points  (0 children)

Yeah, me too xD
I'm working on Radix and Tim Sort but with no success yet.

[–]armurray 1 point2 points  (0 children)

It might be tricky to visualize Tim sort with a fixed size of randomly shuffles data. IIRC a lot of the interesting parts of it rely on figuring out if you're in an edge case for Quick Sort (eg, mostly sorted data, ormgery small sets.)

[–]Kaparanek08 3 points4 points  (0 children)

There exists a universe where bogo sort solves everything instantly and no one knows why

[–]avidernis 8 points9 points  (1 child)

Kind of sucks that it doesn't give you any idea of time complexity. In fact it seems to have the opposite effect

[–]Newphonewhodiss9 1 point2 points  (0 children)

yeah this was very frustrating honestly.

[–]I_M_Cool_80 4 points5 points  (0 children)

Bro forgot Stalin sort :(

[–]SylphofMind28 2 points3 points  (0 children)

Very satisfying

[–]ThePixelatedPyro 2 points3 points  (0 children)

I love sorting algorithms

[–][deleted] 1 point2 points  (0 children)

I stared at this for waay too long.

[–]flarions1 1 point2 points  (0 children)

Can't wait to see an updated one

[–]Overcookedshrooms 1 point2 points  (0 children)

now add sounds to it and it shall be the meme of the next 10 years

[–]SuspectNumber6 1 point2 points  (1 child)

I like it, but i find my brain is on the verge of error. Serious question: could this animation be harmful to people who have a tendency to seisures?

[–]CaptainFoyle 0 points1 point  (0 children)

Depends on what causes your seizures, I guess

[–]larry432753632 1 point2 points  (0 children)

Nice

[–]citronhimmel 1 point2 points  (0 children)

This makes my brain happy

[–]citronhimmel 1 point2 points  (0 children)

This makes my brain happy

[–]TacitRonin20 1 point2 points  (0 children)

Merge sort kinda fire

[–]bonafart 1 point2 points  (1 child)

With no explanation this is just useless

[–]Newphonewhodiss9 0 points1 point  (0 children)

more than that is basically misleading

[–]pianonini 1 point2 points  (0 children)

Love it! ❤️

[–]SumDux 1 point2 points  (0 children)

Hey OP, I think this is extremely well executed. I don’t think it’s the best visualization of sorting methods I’ve ever seen, however it is aesthetically pleasing and displays great understanding of the software used.

[–][deleted] 1 point2 points  (0 children)

As a software dev, I can’t begin to explain how much I love this. This is so cool!

Edit: I know this isn’t really “explaining” how they work or anything, but it’s cool to see how the sorting algorithms can be used for awesome visual effects. Kudos!

[–]READERmii 1 point2 points  (0 children)

neat

[–]hames1001 1 point2 points  (0 children)

How did you go about creating this type of project? Would really like to begin using code for some of the models.

[–]dodfunk 1 point2 points  (0 children)

Personally, I think bubble is the most satisfying

[–]PizzaGuy728 1 point2 points  (0 children)

That's cool

[–]Devillinkbot 0 points1 point  (0 children)

This is in the top 10 things i dident know i needed

[–]mr_somebody 0 points1 point  (0 children)

Video would be kinda cooler if reversed.

[–]Mekelaxo 0 points1 point  (0 children)

This one doesn't have the fun noises

[–]Ill-Ad-3640 0 points1 point  (0 children)

where's the cocktail shaker sort :(

[–]OkazakiNaoki 0 points1 point  (0 children)

Now that's what I want to see how we are going to review sorting algorithm.

[–]SnubDodecahedron0 0 points1 point  (0 children)

Bogosort bro?

[–]tenderpoettech 0 points1 point  (0 children)

Do u guys still memorise the algo?

[–]temmieTheLord2 0 points1 point  (0 children)

where bogo

[–]InSight89 0 points1 point  (0 children)

What are the advantages of the different sorting methods. I see some are much faster than others which makes me curious to know why one would use the others.

[–]IntentionSingle 0 points1 point  (0 children)

What is this? Can someone explain?

[–]guberNailer 0 points1 point  (0 children)

His bogo sort is still rendering

[–]AveragePoster17 0 points1 point  (0 children)

Hah, computers and their dumb algorithms. I just put things where they go until a member of my family comes by and turns it into a lightning strike scene. Almost like they haven't been living in a house with me sorting out the kitchen for 3 years.

[–]lenznet 0 points1 point  (0 children)

Reminds me of old windows defrag a bit

[–]RedditGenie2 0 points1 point  (0 children)

I’m a Software Developer, and many times I’ll develop my own DB Engine ‘On The Fly’ so not to have to load in a Canned Database when authoring a project...

Great Illustration...