Link to home
Start Free TrialLog in
Avatar of sfun28
sfun28

asked on

LINQ: Distinct, Ordered array. algorithm speed

Folks,

I'm looking to take an array of integers and produce a second array that contains the unique integers from the first array and sorts them.

Is it faster to do Distinct().OrderBy( n => n)
or OrderBy(n => n).Distinct()
or are these equivalent?

ASKER CERTIFIED SOLUTION
Avatar of lazyberezovsky
lazyberezovsky
Flag of Belarus image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sfun28
sfun28

ASKER

thanks!!! exactly what I was looking for.