

Comb Sort - Just As Good As Quick Sort - samratjp
http://en.wikipedia.org/wiki/Comb_sort

======
wcarss
The guy who originally devised the algorithm is a professor at the University
of Guelph, in Ontario, Canada. He's a pretty interesting professor - escaped
from being drafted into the Polish army during World War II, wrote some of TCP
at Stanford in the 70's, somehow ended up teaching networking, operating
systems, and some other random subjects in an off-the-beaten-path Canadian
school that's mostly known for farming.

I'm a student there; it's neat to see an article about his creation pop up. :)

~~~
statistic
Heh. I was excited to see it as well. I originally thought you had posted it
when I saw it.

------
gjm11
The article neither claims, nor offers any evidence, that comb sort is "just
as good as quick sort"; could someone fix the title here, please?

I'd guess that it probably performs about as well as Shell sort: hard to
analyse, strongly dependent on the detail of how your increments are chosen,
typically worse than _O_ ( _n_ log _n_ ).

------
moultano
I'm going to need some citations before I believe that it's just as good as
quick sort.

------
dasht
Sorry if this is too meta but:

I usually think the wikipedia.org items on HN are just a silly waste of time
(e.g, not _news_ ) but I do have to admit that this one got me. Neat
algorithm. Hadn't heard of it prior and wouldn't have thought of it
spontaneously.

~~~
drallison
I like the occasional wikipedia article on HN. They are often illuminating and
amusing.

------
pmiller2
Does anyone know of a proof that this really is an $O(n log n)$ sort? I can
sort of see it intuitively, but I can't quite convince myself it is true.

~~~
asmosoinio
I'd guess it is generally O(n log n) for random data, but not mathematically.
At least seems to me that an for an inverted range (n, n-1, n-2, ... 0) the
algorithm will come down to O(n^2). I could be wrong though, didn't really
think about it for that long.

Edit: I might be in the wrong here. I did some quick tests with this code
(<http://yagni.com/combsort/combsort.py>) and did not find it to be much
slower when data is a reversed range vs. sorted range. So much for that
intuitive thought.

