IComparerT
IComparer<T> is a generic interface in the .NET platform, defined in System.Collections.Generic, that provides a way to supply external comparison logic for objects of type T. It enables custom ordering without requiring the objects themselves to implement any particular comparison behavior. This makes it useful for sorting, searching, and other ordered operations on collections of T.
The interface defines a single method: int Compare(T x, T y). The method returns a negative value
Usage often involves implementing IComparer<T> in a dedicated class and passing an instance to sorting methods,
Relation to other comparers: IComparer<T> is the generic counterpart to the non-generic IComparer in System.Collections. If