[Tutor] Sorting algorithm?
VanL
vlindberg@verio.net
Wed, 04 Apr 2001 15:57:07 -0600
Tim Peters wrote:
>
> It's a hybrid algorithm, using binary insertion sort on "small" slices and
> samplesort on "large" slices. samplesort is an extreme variation of
> quicksort, that reduces the asymptotic number of expected compares down to N
> * log2(N). This makes the expected number of compares comparable to
> mergesort (close to the theoretical minimum), but samplesort requires far
> less data movement than mergesort. Compares are expensive in Python, so
> minimizing compares is the primary goal for a Python sort.
Thanks for your informative reply. Just two quick questions:
1. Why are compares expensive in Python? Is this because type must be
idenitfied first?
2. Do you know of a good page that describes the samplesort algorithm?
A search or two on google found some notes on parallel implementation of
the algorithm, but none on the algorithm itself.
Thank you,
Van