Rainbow Sort Visualisations
31–40 of 53 posts
Re: Rainbow Sort Visualisations
#32Really nice. The examples suggest to me that a lot of algorithms would be more accessible to people if they could be visually represented in some way. The timing is important -- the slowness of the bubble sort compared to the quickness of the quick sort gives one an immediate sense of why one would generally want the latter over the former.
I'm more interested in the visual aesthetic, but I've built a few sculptures[1] visualizing algorithms. It's something I'm hoping to expand on when I have more time and resources. I'd write a bit more about them, but I'm on my phone getting ready for work. [1] http://wollw.github.io/Cellular-Polymaton http://m.youtube.com/watch?v=N_smOznDDJs http://m.youtube.com/watch?v=vbtvAQLDcrs
Re: Rainbow Sort Visualisations
#33Re: Rainbow Sort Visualisations
#34This is excellent and a great teaching tool. I tried putting something like this together a while back as a Java applet for one of my classes but couldn't get the color ordering function to work correctly. Did you use HSB?
Yeah indeed, well, hsl with varying hue and set saturation + luminescence - see https://github.com/lorenzo-stoakes/Rainbow-Sort/blob/master/....
I experimented with RGB and it really didn't work, HS(B/L) work a million times better. Took a bit of trial and error!
Re: Rainbow Sort Visualisations
#35Only more colourful and interactive.
Re: Rainbow Sort Visualisations
#36not as nice, but shows different algorithms and their speed
Re: Rainbow Sort Visualisations
#37Earlier quoted context omitted.
Try turning down the block size (the value that defaults to 20), that will make it far slower - try 5. I know that isn't too obvious, but this was something of a quick hack :)
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…
Re: Rainbow Sort Visualisations
#38This is excellent and a great teaching tool. I tried putting something like this together a while back as a Java applet for one of my classes but couldn't get the color ordering function to work correctly. Did you use HSB?
Thanks! That's very kind of you :) Yeah indeed, well, hsl with varying hue and set saturation + luminescence - see https://github.com/lorenzo-stoakes/Rainbow-Sort/blob/master/... . I experimented with RGB and it really didn't work, HS(B/L) work a million times better. Took a bit of trial and error!
https://www.dropbox.com/s/0pjmjllmqh1x4ap/Screenshot%202014-...
I'm going to experiment with HSL and see if I can get it to work. Thanks again!
Re: Rainbow Sort Visualisations
#39Re: Rainbow Sort Visualisations
#40I'm seeing waaaay too much stuff happen all at once for quicksort. Frankly, most visualizations give you an inkling as to the logic behind an algorithm, but quicksort just sort of pops the field into the correct order in a blur. Another classic sorting algorithm to visualize is heapsort.
Try turning down the block size (the value that defaults to 20), that will make it far slower - try 5. I know that isn't too obvious, but this was something of a quick hack :)