Sorting

Bloodstein

Member
Joined
Jul 1, 2003
Messages
10
Ive got a collection that Id like to sort. It is of highest priority that the sorting has to be fast. Memory space is an issue but not as much as sorting speed. Also, Id like the sorting algorithm to work fairly well for large (infinity) number of objects as for small number of objects.

Is there any sorting algorithm that does this. Quicksort is good...but i heard after a certain number of elements, the algorithm slows down rapidly.
 
You say you have a colletion so Im assuming you have an array or ArrayList . Did you try the sort method of the array?
 
You can also look into the IComparer and IComparable interfaces and how you can use it w/ a call to Array.Sort(). That way, you dont have to devise your own sorting algorithm.
 
Back
Top