Determines whether the specified sequence is sorted.
public static bool IsSorted<T>(this IEnumerable<T> source)
| parameter | description |
|---|---|
| T | The element type. |
| source | The sequence. |
true if the specified sequence is sorted; otherwise, false.
Determines whether the specified sequence is sorted.
public static bool IsSorted<T>(this IEnumerable<T> source, IComparer<T>? comparer)
| parameter | description |
|---|---|
| T | The element type. |
| source | The sequence. |
| comparer | The comparer. |
true if the specified sequence is sorted; otherwise, false.