Techniques for Sorting a List in C# - Code Maze In this article, we will explore different techniques for sorting a list. The C# language provides us with a variety of ways in which we can accomplish this task. We will also implement our own custom class which will allow us to maintain a list of data in a sorted fashion.
Table of contents
Setting Up Our Example CodeIComparable<T> Interface for Sorting a List in C#IComparer<T> Interface for Sorting a List in C#The Comparer<T> Abstract ClassSorting With The Comparison<T> DelegateConstraining the Sorting to a RangeCustom MySortedList<T> Implementation for SortingConclusionSort: