At 12:58 AM 12/4/01 +0000, you wrote:
OK, I'll admit it. I've used a bubble sort -- I
had a list of 5 items to
sort, no sort routine in the standard library, and run time was not that
important. A bubble sort seemed to make sense there.
So the original statement was a little strong, sure. But equally, I've
seen the bubble sort be used in far too many places where it was the
wrong choice...
-tony
I've used it just a few days ago, while ordering the row indexes
of elements in each column of the incidence matrix of _very large_
networks. However, these networks are very sparsely connected,
with usually just two connections per node, and the average number of
connections per node is 2.3-2.6 . This means that in most cases a bubble
sort will swap data at most once for each column. Definitely the
best algorithm for the problem at hand.
carlos.
--------------------------------------------------------------
Carlos E. Murillo-Sanchez carlos_murillo(a)nospammers.ieee.org