0
Answer

SortedDictionary v.s. Dictionary

George George

George George

16y
4.4k
1

Hello everyone,


Here is my understanding of pros and cons SortedDictionary v.s. Dictionary, am I correct? Or anything important missing? What is your practices of when to use SortedDictionary and when to use Dictionary?

1. Dictionary is faster for insertion and removal, but slower for query value by key compared with SortedDictionary;
2. Dictionary is using a linear array to store key/value pair, but SortedDictionary is using binary search tree to store key/value pair, so for query, SortedDictionary is faster.


thanks in advance,
George