Does C# have a std::nth_element equivalent?
问题 I'm porting some C++ code to C#. Does C# have an equivalent to std::nth_element() or do I need to roll my own? 回答1: I presume you are looking for an accessor that returns the Nth element of an unordered collection by performing a partial-sort on the collection. This tends to be useful when you have a very large collection and are interested in one of the first elements based on some ordering predicate. To my knowledge, neither the .NET BCL or LINQ extensions offer an equivalent. All of the