On Mon, 10 Sep 2007 17:35:01 -0400
Michael Jennings <[EMAIL PROTECTED]> wrote:

> On Monday, 10 September 2007, at 17:02:44 (-0400),
> Youness Alaoui wrote:
> 
> > And did you not read my example of the sorting algorithm or did you
> > ignore it because you take offence to how I present it?
> 
> I don't take offense at your examples.  I don't even take offense at
> your excessive ad hominem attacks; to take offense, I would have to
> concede that you have the standing from which to make them.  I have
> not done so.
> 
> As I said, your example was simply incorrect.  Quicksort is O(n log n)
> in the average case and O(n^2) in the worst case.  Bubble sort is
> always O(n^2).  So, barring the inherent random variances in a small
> sample set, bubble sort will not be faster than quicksort, even for
> small data sets.  Feel free to consult
> http://en.wikipedia.org/wiki/Sorting_algorithm for the particulars.
> 
> Michael
> 

While it's true that bubble sort isn't ever going to be faster, that's
not just because it's always O(n^2). Insertion sort is also O(n^2), but
it does outperform quicksort on small data sets (under 10 elements or
so)... highly optimized sorting algorithms often use quicksort to sort
large data sets, but switch to insertion sort once the partitions drop
below a certain size, since it's faster. See
http://en.wikipedia.org/wiki/Insertion_sort for details.

Jesse

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to