Live data from Hacker News

Rainbow Sort Visualisations

ljs.io

1–10 of 53 posts

Re: Rainbow Sort Visualisations

#3
post #2

I love this as a visualisation. It would be great to provide links to the algorithms (if they were there, I didn't find them).

Thanks :)

Full source code is available at https://github.com/lorenzo-stoakes/Rainbow-Sort, no guarantees as to quality... all (4 :P) algorithms are there.

Re: Rainbow Sort Visualisations

#4
I'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.

Re: Rainbow Sort Visualisations

#5

I'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 :)

Re: Rainbow Sort Visualisations

#7

This is awesome. One thing I'd love to see is the ability to slow it down without decreasing the block size.

Thanks :D

This was just a quick hack a year or so ago, am open to enhancing it though - feel free to post any suggestions over at https://github.com/lorenzo-stoakes/Rainbow-Sort/issues :)

Re: Rainbow Sort Visualisations

#8
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.

Re: Rainbow Sort Visualisations

#9
post #7

This is awesome. One thing I'd love to see is the ability to slow it down without decreasing the block size.

Thanks :D This was just a quick hack a year or so ago, am open to enhancing it though - feel free to post any suggestions over at https://github.com/lorenzo-stoakes/Rainbow-Sort/issues :)

Add bogo sort and gnome sort.
Post reply on HN