c# - What sorting algorithm does the .NET framework implement -
this question has answer here:
could please advise when implementing icomparable in .net sorting algorithm .net use sort underlying data? algorithm used customizable or selectable?
there 2 biggies.
array.sort
(which sorts array in-place) uses unstable quicksort.
this same implementation used internally list<t>.sort
, according msdn documentation:
this method uses
array.sort
, uses quicksort algorithm.
the enumerable.orderby<tsource, tkey>
method (which sorts copy of input sequence) uses stable quicksort.
as far know, these 2 sorting implementations in .net bcl.
Comments
Post a Comment