[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Low-level vs. High-level programming (was My First Computer)
In article <20030619155058.09031.00001455@mb-m18.aol.com>,
Michael J. Mahon <mjmahon@aol.com> wrote:
>This reminds me of an amusing story...
>
>Bubble sort was never the best algorithm to use for sorting, regardless
>of data set size. However, he went on, bubble sort was apparently the
>most "intuitive" sorting algorithm, the one "invented" by most people
>when asked to write a sorting algorighm, and so it was the "best" for
>teaching people _about_ sorting algorithms! ;-)
Odd. I "invented" selection sort. And anyone who intuitively "invents" an
n log n sort is a mutant, and will go far in the computing world :-)
You could probably rig things to make bubble sort useful -- make it so
data movement cost is proportional to the distance of the movement.
>(BTW, for very small numbers of items, the "repeatedly pick lowest
>and set it to infinity" algorithm ("pick and zot") is usually the fastest,
>although it is exactly n**2.)
I believe that's the selection sort by another name.
--
Matthew T. Russotto mrussotto@speakeasy.net
June 20, 2003 is GIF Freedom Day (US)