Show all posts.
How to do a simple sorted list in C# ? Here it is:
| C# |
1
2
3
4
5
6
7
8
|
class MySortedList<T> : List<T>
{
new public void Add(T item)
{
int index = BinarySearch(item);
Insert(index >= 0 ? index : ~index, item);
}
}
|
(andrás & moszi coop)
|