Why aren't we all speaking LISP now?

Christian Tanzer tanzer at swing.co.at
Sat May 12 03:05:01 EDT 2001


"Alex Martelli" <aleaxit at yahoo.com> wrote:

> I've heard it claimed that 'bubble' is a more natural
> way to sort.  I just can't get it.  As a bridge player,
> I find myself in an environment where people are very
> often sorting small sets (bridge hands they were just
> dealt) compared with everyday life, and when kibitzing
> other players I have the opportunity to observe how they
> set about it.  It seems to be, for most people, first
> a pass of bucket sort (more or less), separating cards
> by suit, then on each suit roughly a selection sort --
> each card is generally moved only once (typical of a
> selection sort over a linked list, where putting the
> new found subsequence-minimum to the right place only
> requires "moving" it, not also moving another item as
> in a typical item-swap for an array), roughly to its
> final resting place.  I've NEVER seen the sequences of
> small card-position moves (repeated swap of an item
> with its adjacent one) typical of bubblesort...

Different people tend to use different sorting algorithms.

My first exposure to sorting algorithms was a class assignment (in a
course named something like Astronomical Computational Methods) where
each student had to outline a sorting algorithm. It was a suprise to
all (but for the teacher perhaps) that we came up with almost as many
different algorithms as there were students (but nobody came up with
something like quicksort :-). And we immediately started arguing which
one of the algorithms was intuitive <wink>. 

-- 
Christian Tanzer                                         tanzer at swing.co.at
Glasauergasse 32                                       Tel: +43 1 876 62 36
A-1130 Vienna, Austria                                 Fax: +43 1 877 66 92





More information about the Python-list mailing list