cliftonm / morelinq

Automatically exported from code.google.com/p/morelinq
Apache License 2.0
1 stars 0 forks source link

It would be nice to have a Top operator that would merge OrderBy and Take #103

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This same argument for Max and Min could be applied to this operator. The main 
benefit would be performance, but I think it actually might be more readable. 
Without the requirement of sorting the entire list, you move from an average 
case of O(n log n)for an optimal sorting algorithm to O(n) for an optimal 
selection algorithm.

Original issue reported on code.google.com by Pope...@gmail.com on 27 May 2015 at 9:49