I need to determine if two sets contain exactly the same elements. The order does not matter.
For example, these two arrays should be considered equal:
IEnumerable<int> data = new []{ 3,5,6,9 }; IEnumerable<int> otherData = new []{ 6,5,9,3}
One set cannot contain any elements that are not in another.
Can this be done using the built-in query operators? And what would be the most effective way to implement it, given that the number of elements can vary from a few to hundreds?
driis Nov 04 '09 at 11:57 2009-11-04 11:57
source share