This is a sorting algorithm demonstration tool. I made this because I wanted to end the year with a fun save. Don't give me that look, yes, I find this incredibly fun! :P My absolute favourite is Heapsort, despite the fact that it's not a stable sort.
computer
subframe
sorting
algorithm
r216k2a
z2tags
z1more
z0no
z4everyone
z3thanks
Comments
-
Here's a cool thing you could try if you add reverse sorts: A "smart sort" that determines whether it could be easier or harder to sort in reverse or forwards, and maybe choose the most efficient sort moveset for a particular step. I get the feeling that, by having a program choose what the smartest move would be besides ugly hacks, that it could be the second fastest below ugly hacks by using the easiest sort pattern and making the best moves for a particular sort.
-
@jacob1: A reaction fitting for a programmer :P Thanks for timing the algorithms, I probably should have done that myself. The measurements nicely show that even though Heapsort is O(nlogn) just like Quicksort in the best case, with this small a dataset its overhead is so high that it's slower than the theoretically O(nn) Selection Sort.
-
@schradieck: I might, but I think it's confusing enough as it is :P
-
Whew, this is getting more love than I expected.
-
This is incredible, I watched all the algorithms for like 20 minutes (maybe should have raised the fps cap). I ran all the algorithms with the same randomized input to see how fast they are. quicksort: 1 minute. heapsort: 1 minute 57 seconds. bubble sort: 3 minutes. insertion sort: 2 minutes 30 seconds. selection sort: 1 minute 19 seconds. ugly hacks: 16 seconds.
-
funny i see this now, as recently i've been watching quite a few videos on sorting algorithms,
-
R33sesK1ng: I mean circuitry glitches.
-
you should add an option to do a quick reverse sort, because a lot of sorting algorithims can be slower/faster sorting something that's in reverse order
-
@XGEM_Gaming, Not sure if it's a glitch so much as it is just... destruction...
-
@LBPHacker, lmao that was meeeeeeee