I am trying to filter an IEnumerable object of the duplicate values, so I would like to get the distinct values from it, for example, lets say that it holds days:
monday tuesday wednesday wednesday
I would like to filter it and return:
monday tuesday wednesday
What is the most efficient way to do this in .net 2.0?
Dictionary will use a hash table to hold keys therefore lookup is efficient.
Sorting will be O(n log(n)) at best. A hash table with an efficient hash function often outperforms it (O(1) lookups).