object that supports IComparer, the SortedList looks for an IComparable interface on the contained
key objects to do the comparison. Naturally, you’ll need to provide an explicit comparer if the con-
tained key objects don’t support IComparable. The overloaded versions of the constructor that
accept an IComparer type exist specifically for that case.
The generic version of the sorted list, SortedList<TKey, TValue>, follows the same sort of pat-
tern. When you create a SortedList<TKey, TValue>, you have the option of providing an object that
implements the IComparer<T> interface so it can compare two keys. If you don’t provide one, the
SortedList<TKey, TValue> defaults to using what’s called the generic comparer. The generic com-
parer is simply an ...