The .NET Framework includes a standard set of interfaces used for sorting and comparison. By implementing the IComparable interface, classes and structures can advertise their ability to be sorted by their containers. The .NET Framework provides two classes that implement the IComparer interface, which is used to compare other objects. The Comparer class is used for basic comparisons and assumes that the compared types implement IComparable. The CaseInsensitiveComparer class is similar, except it performs a case-insensitive comparison for string objects.
The .NET Framework also includes a wide variety of collection types, including types that implement queues, stacks, and hash tables. The System.Collections namespace includes both concrete types and interfaces that can be used to create new collection types. The System.Collections.Specialized namespace includes a set of types that are used for specific purposes.