which of these 2 quicksorts is faster?

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Wed Sep 10 07:06:23 EDT 2008


On Wed, 10 Sep 2008 03:17:30 -0700, process wrote:

> qsort can handle bigger lists it seems, making less recursive calls
> before finishing(quicksort blows the stack when sorting
> range(100,-1000,-1).

It just seems so because that `range()` list is the worst case for 
`quicksort()` but not for `qsort()`.  If you feed `qsort()` a list 
constructed to always leave one recursive call with the empty list, it 
will reach the recursion limit too.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list