I’m currently implementing a very complex tree structure to allow for near-instant data access, instead of re-processing on each request.
I’m just wondering if there is a theoretical, or practical, limit at which the size of a tree becomes too big, or a point at which a dictionary becomes too collision-filled to function correctly/quickly?
A general answer would be appreciated but C#-specific information would be much better!
In .NET the maximum in either a Tree or Dictionary is 2^31 – 1 (and probably a few less with overhead).
In practical terms, you will probably have run out of memory long before then!
If the tree remains balanced then searches will remain approx. O(log N).
Dictionaries are more sensitive to the underlying algorithm used, for instance there are many hashing schemes with different characteristics.