Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!motcid!smithc From: smithc@motcid.UUCP (Chris Smith) Newsgroups: comp.edu Subject: Re: ALGORITHMS ANYBODY? Message-ID: <4370@indigo.UUCP> Date: 23 Aug 90 20:09:47 GMT References: <90Aug22.090345edt.9450@neat.cs.toronto.edu> <12868@june.cs.washington.edu> Organization: Motorola Inc., Cellular Infrastructure Div., Arlington Heights, IL Lines: 30 In article <12868@june.cs.washington.edu>, pattis@cs.washington.edu (Richard Pattis) writes: > In article <1990Aug22.182415.27036@newcastle.ac.uk>, Chris.Holt@newcastle.ac.uk (Chris Holt) writes: > > DON'T use bubble sort; once people learn it, they use it for the > > rest of their lives, it seems like, and it takes ages to unteach. > > ... > > What exactly is wrong with bubble sort? It is the smallest sorting algorithm > ... I agree with Chris, once bubble sort is learned, it is invariably used. A professor of mine in grad school claimed this was because it had a nifty name :-). Simply put, insertion or selection sorts are as simple to write, once learned, as is bubble sort. Their performance is better with near random data due to the far fewer number of data swaps occuring. While working for a defense contractor, I found a bubble sort executing on random data with repetition where the boolean function was less-than or equal. The software was a realtime EW suite. Granted, the original engineer had a foolish boolean operation, however the sort itself was terribly inefficient. The engineer's reaction when question was 'I know that. I took data structures too!'. I would prefer bubble sort was left as an example for an algorithms course when comparing complexities of common sorts, not introduced in early language classes. -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^ Chris Smith @ Motorola Inc. "I know life is unfair, but why can't it be ^ ^ ..!uunet!motcid!smithc "unfair in my direction sometime" <--LEVITY ^ ^-------------------My thoughts, not my employer's------------------------^