Sorted collection class in Silverlight 4?

Does anyone know about a sorted collection class in Silverlight 4? SortedSet <T>, SortedList <T>, and SortedDictionary <T> all seem to be missing.

Of course, I can use List <T> .Sort () or the extension method IEnumerable <T.OrderBy (). But I would prefer not to sort O (n log n) every time an item is added or removed.


Thanks for your help,
Richard.

+3
source share
3 answers

, Silverlight (?)

The C5 Generic Collection Library, , , , , .

Silverlight Toolkit Red-Black.

+2

I was looking for something similar to SortedList in .NET (something that remains sorted without using LINQ over a dictionary or collection for sorting). I could not find anything, so I came up with this solution. It works like a dictionary, maintaining a collection of keys and values ​​and keeping both collections sorted by key.

http://pastebin.com/CiUbe28c

0
source

Source: https://habr.com/ru/post/1776350/


All Articles