Why aren't we all speaking LISP now?
Delaney, Timothy
tdelaney at avaya.com
Sun May 13 20:38:09 EDT 2001
> 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...
I find when playing cards (I don't play bridge, but a played a lot of Buraco
in Brasil, where you often find yourself holding 20+ cards in your hand)
that I tend to do a mixture of selection sort and insertion sort, with my
sorting criteria being suit first, then number.
If I have a group of cards from the same suit close together, I will remove
any which don't match and put them in the correct order. Then I sort within
the suits.
However, the way I fan my cards out in my hand leaves the numbers at the
*bottom*, which freaks everyone out as I'm holding the cards *upside down*
(in their minds). So I may be atypical in my sorting too ;)
Tim Delaney
More information about the Python-list
mailing list