Method InsertOrdered
InsertOrdered<T>(List<T>, T, IComparer<T>?)
Inserts an item into an already sorted list.
public static int InsertOrdered<T>(this List<T> sortedList, T item, IComparer<T>? comparer = null)
Parameters
sortedListList<T>The sorted list.
itemTThe item to insert.
comparerIComparer<T>A custom comparer to use when comparing the item against elements in the collection.
Returns
Type Parameters
TThe type of item to insert.