Take the tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am litle curious about what sorting algorithm is using OrderBy (linq to objects). quicksort? heapsort? introspective sort ?

As i see in MSDN documentation List.Sort is using introspective sort: see: http://msdn.microsoft.com/en-us/library/b0zbh7b6.aspx

Maybe OrderBy use the same?

If we go to order by documetation i don't see much information: http://msdn.microsoft.com/en-us/library/system.linq.enumerable.orderby(v=vs.110).aspx

share|improve this question
add comment

1 Answer

Apparently it uses a stable quicksort.

This has been verified using reflector.

See: http://stackoverflow.com/a/2792105/569777

share|improve this answer
 
could be, sadly was ansewered 2 years. As i can see it, the implementation from one version to another version of framework could be different (example: array.sort from fm2 was quicksort and for the fm4.5 is introspective sort ) –  Rolando Dec 13 at 21:01
2  
Reflector is your friend :) –  MetaFight Dec 13 at 21:02
 
@MetaFight There are also free alternatives, like dotPeek. –  svick Dec 13 at 21:50
 
True. I keep forgetting it isn't free anymore. –  MetaFight Dec 13 at 22:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.