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
-
Two very related posts on SO here (About LINQ based Sorting) and here (About Array data type sorting)RBT– RBT2017年08月23日 02:17:54 +00:00Commented Aug 23, 2017 at 2:17
1 Answer 1
Apparently it uses a stable quicksort.
This has been verified using reflector.
-
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– Rolando2013年12月13日 21:01:18 +00:00Commented Dec 13, 2013 at 21:01
-
2
-
@MetaFight There are also free alternatives, like dotPeek.svick– svick2013年12月13日 21:50:47 +00:00Commented Dec 13, 2013 at 21:50
-
True. I keep forgetting it isn't free anymore.MetaFight– MetaFight2013年12月13日 22:09:55 +00:00Commented Dec 13, 2013 at 22:09