What's the best way to determine whether two List<T> objects contain the same set of values, even if they are not in the same order? [duplicate]
问题 This question already has answers here : Compare two List<T> objects for equality, ignoring order [duplicate] (9 answers) Closed 4 years ago . I have two List<T> objects (where T is the same type for both objects), and I need to be able to determine whether they contain the same set of values, even if the values aren't in the same order. Do the objects have any built-in mechanisms to accomplish this, or do I need to write my own algorithm? Or perhaps, should I be using a different type of