You are here: irt.org | About | Feedback | 4091 [ previous next ]
Feedback on:
irt.org FAQ Knowledge Base Q501
Sent by
Damon Floyd on August 22, 2002 at 17:02:26:
Worth:
Very worth reading
Comments:
First off, this is a great site. It contains a library of useful information that I reference frequently when I have a question. That being said, I have some feedback on the response to this question.
Sorting is obviously something that can been accomplished through a variety of methods. The performance of most sorting methods vary based on the condition of the dataset. Some are obviously better suited to certain scenarios. However, the Bubble Sort is best used as an example of how not to design a sorting algorithm. Anything with a big-O of N2, or larger than N log N for that matter, iterative or not, should not even be considered where efficiency is a concern. In addition to the number of passes required for the Bubble, the amount of movement in the data is astronomically high. Sorting a list of even moderate length with elements of moderate size will quickly reveal this deficiency.
Recursive sorts, like the well-known Shell or Insertion, usually are far more efficient. But, as in this case, if the developer is concerned that there will not be enough memory for the stack, and is confined to an iterative algorithm, Bubble should be the most remote of a consideration.
If you would like more information on some efficient iterative sorts, shoot me an email.
Thanks and keep up the good work,
Damon Floyd