"Dan" <da*@dontspamme.com> wrote in message news:eE**************@tk2msftngp13.phx.gbl...

The documentation says that Array.Sort(myArray, IComparerObject) uses a

quicksort:

"This method uses the QuickSort algorithm. This is an O(n ^2) operation,

where n is the number of elements to sort, with an average of ?(n log n)."

I tested the ArrayList sort and compared it to my* sort. I thought mine was fast but the arraylist sort was significantly faster

(3.6 times faster). The bubble sort took huge amounts of time, I stopped it before it finished. If the op is getting poor results it

must be because their algorithm is slow. It could also be slow because of incorrect data being returned , eg if you tell it A > B

and B > A it is bound to get confused.

Results for sort of 100,000 items (Time (ms), Comparison Count):

My Sort 2895, 4,066,741

Arraylist sort 771, 2,223,288

Bubble Sort 2,500,000, 5,000,000,000

The time for the bubble sort was estimated cause I got sick of waiting :-)

*It's not really my sort, I pinched it from a website somewhere, all I did was package it into a reusable class. :-)

--

Michael Culley