[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Low-level vs. High-level programming (was My First Computer)



"Paul Schlyter" <pausch@saaf.se> wrote in message
news:bcsp35$ov7$1@merope.saaf.se...
> Of course not!  So we can agree bubblesort is here an "extremely
> bad algorithm".  And one wouldn't need to be a brilliant Java
> programmer to write a quicksort which outperformed a bubblesort
> written in C.

Bubblesort is a lousy general-purpose sorting algorithm.  But in the rare
case where either you know your data is mostly sorted anyway, or the data
set is quite small, then the bubble sort is a good choice.  Modified bubble
sorts are often used as a special-case routines in industrial-strength
sorting libraries.

As I've said before, have a big toolbox and use the right tool for the job
:)

Kelly