Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ArrayList.Sort() versus QuickSort(ArrayList)

Status
Not open for further replies.

mgriffith

MIS
Jul 3, 2001
177
US
anybody know what the arraylist's sort member actually is? it seems to me that it's probably not a quicksort because microsoft shows the implementation of a quicksort on an arraylist in the .net introduction on msdn. or maybe that means it is a quicksort...i really don't know.

i've always used quicksort's in my c++ apps and they seem to be about as quick as anything....what do you think as far as sorting between 2 and 500 strings...i realize i probably shouldn't use quicksort if the element count gets low, should probably call an insertion sort when count < 20

thanks.
[afro] mike griffith
----------------------------
mgriffith@lauren.com
mdg12@po.cwru.edu
 
i found it

straight from microsoft (------------------------------------
Remarks
This method uses Array.Sort, which uses the QuickSort algorithm. This is an O(n log2 n) operation, where n is the number of elements to sort.
-------------------------------------- mike griffith
----------------------------
mgriffith@lauren.com
mdg12@po.cwru.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top