Collection Classes
- slide 15 : 36
Sample use of Sort in
List<T>
An illustration of three different overloads of
Sort
operations
Four different activations of the List.Sort method.
Output of the sorting program.
Lessons learned
Some types have a default comparer which is used by
List.Sort()
The default comparer of T can extracted by
Comparer<T>
.Default
An
anonymous delegate comparer
is attractive if the default comparer of the type does not exist, of if it is inappropriate.
Shuffle List
Course and Project classes