When to use a SortedList over a SortedDictionary?

I’m not sure how accurate the MSDN documentation is on SortedList and SortedDictionary. It seems to be saying both are implemented using a binary search tree. But if the SortedList uses a binary search tree, why would it be much slower on additions than SortedDictionary? Anyway, here are some performance test results. Each test operates … 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