Live data from Hacker News

Rainbow Sort Visualisations

ljs.io

21–30 of 53 posts

Re: Rainbow Sort Visualisations

#25
post #14
post #5

Earlier 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 :)

Yeah, the problem is it just sort of "happens" without me being able to understand what's going on behind the scenes. For instance, all of a sudden half the screen is slightly more sorted, but I have no clue what went into getting it that way, even though it took more time to do so.

Yeah, I think I need to review this code + make it 'fairer' or at least somewhat smoother. The positive reaction here has motivated me to hack on this project again!

Re: Rainbow Sort Visualisations

#26
post #5

Earlier 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…

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! :)

Re: Rainbow Sort Visualisations

#28

Really 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.

This is a fantastic set of visualisations that was posted on here before at some point - http://www.cs.usfca.edu/~galles/visualization/Algorithms.htm...

Re: Rainbow Sort Visualisations

#30

Really 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

Post reply on HN