Type Reason InvalidOperationException The default comparer cannot find a IComparable<T> or IComparable implementation for type T.
This method uses the default comparer for type T to determine the order of list elements. If there is no default comparer, then the method throws InvalidOperationException. The default comparer for a given element type T is defined in the Description section of this (class List<T>) specification.
At worst, this operation is O(n2), where n is the number of elements to sort. On average it's O(n log n).