SortedList, SortedDictionary and Dictionary

When iterating over the elements in either of the two, the elements will be sorted. Not so with Dictionary<T,V>. MSDN addresses the difference between SortedList<T,V> and SortedDictionary<T,V>: The SortedDictionary(TKey, TValue) generic class is a binary search tree with O(log n) retrieval, where n is the number of elements in the dictionary. In this respect, it … Read more

What’s the difference between SortedList and SortedDictionary?

Yes – their performance characteristics differ significantly. It would probably be better to call them SortedList and SortedTree as that reflects the implementation more closely. Look at the MSDN docs for each of them (SortedList, SortedDictionary) for details of the performance for different operations in different situtations. Here’s a nice summary (from the SortedDictionary docs): … Read more