3 ms·
Sorting algorithms compared and animated
- gruseom 18y agoThis is one of the best things I've seen on HN in a long time. What a great idea! (Doesn't work when I increase the size to 50 though.)
- tomsaffell 18y agoWhole heartedly agree. That this article can make front page is the reason HN gets the majority of my reading time each day.
- ojbyrne 18y agoNo offense, but "long time" is the operative phrase. It's old.
- cnlwsu 18y agowonderful, I want to email this to some of my old professors.
- qiemem 18y agoHere's another page with more algorithms: http://home.westman.wave.ca/~rhenry/sort/ http://home.westman.wave.ca/~rhenry/sort/ Has some fun ones like Stooge sort and Several Unique sort.
- zealog 18y agoThis is great. I wish I could upvote again and again.
- saikat 18y agoAnother page with sorting algorithms animated (with some other algorithms): http://www.cs.ubc.ca/~harrison/Java/sorting-demo.html http://www.cs.ubc.ca/~harrison/Java/sorting-demo.html
- cortesi 18y agoI've always thought that sorting algorithm visualisation could be done better in static images than animation. Here's a blog post on the topic I prepared earlier... ;) http://www.hatfulofhollow.com/posts/code/visualisingsorting/index.html http://www.hatfulofhollow.com/posts/code/visualisingsorting/...
- slackenerny 18y agoThis is so much good of an idea. I remember seeing the exact same animations original poster linked to, no less than ten years ago. I recognize their visual form distincly, because of how they've set back my understanding when I was learning this stuff. There is no limit to pagerank you should receive for preparing this.
- Retric 18y agoWhat I like about the animated approach is showing insertion and bubble sorting beating the others on a nearly sorted set. It's not just a question of what's the best in average or worst case situations but also what format is your data starting out as. Edit: It's not that the other approach can't show the same information rather it takes up more space so it's harder to notice new relationships other than those directly shown.
- silentbicycle 18y agoFantastic post! Thanks for including the source you used to generate those, too. :)
- kurtosis 18y agoThis would make an awesome test question - show the animation and name the algorithm.
- kenver 18y agoThanks for the link it was a good read, this is a good one too, it shows some stats as the sorting operation is happening: http://coderaptors.com/?Sorting_algorithms http://coderaptors.com/?Sorting_algorithms
- access_denied 18y agoThis is also a great page to explain to normal people how computers actually work.