hashTable "properties" C#
is someone know what is the hash function that the hashtable use in C#?
what is the size of the table? is it proportional to the data i'll insert (e.g 30% more then my data)? or it's a fixed size?
can i do the hashTable in one type, like string, or it's alwways return and get an object t开发者_运维知识库ype? i don't want to do casting every time i get a data from the table....
Start by reading the Remarks section of the Hashtable documentation. If you do not find enough details about the implementation you can use .NET Reflector. To have a hashtable with specific key and value types, you should use System.Collections.Generic.Dictionary<TKey, TValue>.
Object.GetHashCode, which can be overwritten bei each class.
No idea, but you should not care as it's an implementation detail. If you want to know it, write a sample program and measure it. But be aware that it might change in the next .Net release.
Have a look at Dictionary
精彩评论