I like Aldo's visualizations a bit better: http://corte.si/%2Fposts/code/sortvis-fruitsalad/index.html
Rainbow Sort Visualisations
41–50 of 53 posts
Re: Rainbow Sort Visualisations
#42Earlier quoted context omitted.
Dude, don't tempt me to add sound :P
Sound is cool at first but then gets way annoying. I had never heard of radix sort, 0 comparisons. Are you planning on adding more sorting algorithms like mergesort?
https://github.com/git/git/commit/8b8dfd5132ce91f632b5303c39...
Re: Rainbow Sort Visualisations
#43Earlier quoted context omitted.
I looked through the code, I see why quicksort is such a blur now, and I don't see an obvious way to fix it. Since you are in a sense, benchmarking these algorithms. One way to do it might be to allow the user to set the timeout in your defer function. Setting the timeout to 1 second lets the user observe each run of your algorithms. You can see the partitioning behaviour a bit better like that. Side note: this code…
I really need to jump back into the code, not looked at it for a while and take a look at improving how 'fairly' it benchmarks the algorithms. That's an interesting suggestion, will experiment with it. Thanks for your kind comment on the code qual :) personally I only see the faults, for one I am sure I could improve perf... year-old code is often that way however! :)
My estimation is that you need to refactor the algorithms such that they hold their state inside a closure, and break after a set number of swaps. Say every 300 swaps they break and the canvas updates. This kind of background processing is such a pain in javascript.
Re: Rainbow Sort Visualisations
#44http://greggman.github.io/doodles/sort.html
click one for a larger version
PS: My method of cycle counting may not make any sense.
See https://github.com/greggman/doodles for details
Re: Rainbow Sort Visualisations
#45Reminds me of this: https://www.youtube.com/watch?v=kPRA0W1kECg
Dude, don't tempt me to add sound :P
And as the others have said - your rainbow viz is really nice, in a lot of ways :)
Re: Rainbow Sort Visualisations
#46Earlier quoted context omitted.
I looked through the code, I see why quicksort is such a blur now, and I don't see an obvious way to fix it. Since you are in a sense, benchmarking these algorithms. One way to do it might be to allow the user to set the timeout in your defer function. Setting the timeout to 1 second lets the user observe each run of your algorithms. You can see the partitioning behaviour a bit better like that. Side note: this code…
Yes, but it should use two spaces for indentation, not a tab; according to coffeescript guidelines.
the statement is true and informative: https://github.com/polarmobile/coffeescript-style-guide#tabs...
to someone who was just learning about coffeescript.
Re: Rainbow Sort Visualisations
#47Why do we educate students to re-implement sorting again?
Re: Rainbow Sort Visualisations
#48How many times do we need to re-implement sorting? Why do we educate students to re-implement sorting again?
Re: Rainbow Sort Visualisations
#49Earlier quoted context omitted.
Dude, don't tempt me to add sound :P
I've played with sound as well with sort visualizations - it has been disappointing and more irritating than enlightening, but maybe there's a proper angle on it somebody will find that adds to the understanding of the algorithm. And as the others have said - your rainbow viz is really nice, in a lot of ways :)