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

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)