News for hackers. Stuff that matters.
Re:JavaScript Visualization of Sorting Algorithms by ck2 on Friday March 11, 2011 @01:53AM (#2312444)
Nice. I'd love a timer on the page somewhere.

Also maybe add introspective sort http://en.wikipedia.org/wiki/Introsort

I vaguely remember seeing something like this on HN before.

Ah, here we go http://www.sorting-algorithms.com/

Re:JavaScript Visualization of Sorting Algorithms by Perceval on Thursday March 10, 2011 @08:32PM (#2311715)
For a while I've been wondering if the German Tank Problem could help make comparison sorts work better on large lists. Unfortunately, I lack the background to test whether this is true.

You wouldn't have to know the upper or lower bounds of the list, you could estimate them progressively from a smaller sample. Then you could insert each item to position N based on your distribution estimate. The further you get through the list, the better the distribution estimate would get, and inserting would get more accurate.

Is this plausible? Has this been done already?

Re:JavaScript Visualization of Sorting Algorithms by foob on Thursday March 10, 2011 @09:29PM (#2311888)
This isn't exactly what you're talking about but I think that it might interest you: Adaptive Data Partitioning Using Probability Distribution by Xipeng Shen, Yutao Zhong, and Chen Ding (http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.1.31...). They estimate the probability distribution using a subset of the data and then use this to determine the partitions.
Re:JavaScript Visualization of Sorting Algorithms by anonymoushn on Friday March 11, 2011 @03:19AM (#2312637)
This seems like a more developed version of what Perceval had mentioned. Using German Tank Problem-based estimates would involve assuming a uniform distribution from the beginning.
Re:JavaScript Visualization of Sorting Algorithms by T-hawk on Friday March 11, 2011 @12:28PM (#2314084)
I'm not aware of any general-purpose package for German Tank Sort, but it is sometimes implemented in specialized applications where you know a distribution is close to uniform. Run one round of estimating, then run bubble sort. The worst-case time of course is N², but if your estimator is sufficiently good and data is sufficiently uniform, you could possibly achieve an average time of fewer than log N passes through bubble sort so break the N log N barrier for your typical case.
Re:JavaScript Visualization of Sorting Algorithms by _sebkom on Friday March 11, 2011 @09:49AM (#2313470)
The visualization is nice but it fails to explain the ideas of each algorithm.

And it's interesting that the best visualizations for this are java applets.

Re:JavaScript Visualization of Sorting Algorithms by tristanperry on Thursday March 10, 2011 @05:41PM (#2311132)
A pretty useful collection. I've seen all these sorting algorithms depicted diagramatically previously, but having these all as a collection where you can change the data set and speed of rendering is pretty nice.

Would be a useful teaching aid IMO, as it quite poignantly demonstrates just how slow some of the 'intuitive' (for new programmers) sorting algorithms can be.

Re:JavaScript Visualization of Sorting Algorithms by elliottcarlson on Thursday March 10, 2011 @05:57PM (#2311183)
Love the visualization, but feel it would be useful to also show the cycles utilized for each algorithm using each of the settings.
Re:JavaScript Visualization of Sorting Algorithms by pwalker on Thursday March 10, 2011 @10:18PM (#2311990)
Pretty memorizing stuff right there. Makes me think of a more efficient way to compare all those lines and fit them into a more efficient order via a shorter algorithm. INtriguing.
Re:JavaScript Visualization of Sorting Algorithms by xhuang on Thursday March 10, 2011 @06:54PM (#2311338)
nice one, the bogo is amazing :)
Re:JavaScript Visualization of Sorting Algorithms by lasr21 on Thursday March 10, 2011 @08:09PM (#2311640)
yeah, BOGO FTW!!
Re:JavaScript Visualization of Sorting Algorithms by EragonJ on Friday March 11, 2011 @12:48AM (#2312304)
It's really impressive xD